Skip to content

Commit

Permalink
Add StatsProcessor
Browse files Browse the repository at this point in the history
Author: @franklinhu
Fixes #48
URL: #48
  • Loading branch information
Franklin Hu committed Jun 26, 2012
1 parent 3e15fe1 commit f010be4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.twitter.zipkin.collector.processor

import com.twitter.ostrich.stats.Stats
import com.twitter.util.Future
import com.twitter.zipkin.common.Span

class StatsProcessor extends Processor[Span] {

def process(span: Span): Future[Unit] = {
span.serviceNames.foreach { name => Stats.incr("process_" + name) }
Future.Unit
}

def shutdown() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ trait ZipkinCollectorConfig extends ZipkinConfig[ZipkinCollector] {
new SequenceProcessor[Span](
new FanoutProcessor[Span]({
new StorageProcessor(storage) ::
new IndexProcessor(index, indexingFilter)
new IndexProcessor(index, indexingFilter) ::
new StatsProcessor
})
)

Expand Down

0 comments on commit f010be4

Please sign in to comment.