diff options
author | Diego <diegolparra@gmail.com> | 2014-05-20 20:42:41 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-05-20 20:46:43 -0300 |
commit | ff6a752352628a878bbde14f67c4be1725b851cf (patch) | |
tree | debda4f7a0df348ecf338fdc8fec83171bce3073 /kamon-core/src/main/scala/kamon/metrics | |
parent | 3939c7c866c6ec4409b11dd0abfa93d10e59788a (diff) | |
download | Kamon-ff6a752352628a878bbde14f67c4be1725b851cf.tar.gz Kamon-ff6a752352628a878bbde14f67c4be1725b851cf.tar.bz2 Kamon-ff6a752352628a878bbde14f67c4be1725b851cf.zip |
+ core: added tests to dispatcher metrics
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metrics')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala b/kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala index e7edce51..529cc542 100644 --- a/kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala +++ b/kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala @@ -18,17 +18,17 @@ package kamon.metrics.dispatcher import scala.concurrent.forkjoin.ForkJoinPool import java.util.concurrent.ThreadPoolExecutor -import akka.dispatch.{ExecutorServiceDelegate, Dispatcher, MessageDispatcher} +import akka.dispatch.{ ExecutorServiceDelegate, Dispatcher, MessageDispatcher } import java.lang.reflect.Method object DispatcherMetricsCollector { - private[this] type DispatcherMetrics = (Long, Long, Long, Long) + private[this]type DispatcherMetrics = (Long, Long, Long, Long) - private[this] def collectForkJoinMetrics(pool: ForkJoinPool):DispatcherMetrics = { + private[this] def collectForkJoinMetrics(pool: ForkJoinPool): DispatcherMetrics = { (pool.getParallelism, pool.getActiveThreadCount, (pool.getQueuedTaskCount + pool.getQueuedSubmissionCount), pool.getPoolSize) } - private[this] def collectExecutorMetrics(pool: ThreadPoolExecutor):DispatcherMetrics = { + private[this] def collectExecutorMetrics(pool: ThreadPoolExecutor): DispatcherMetrics = { (pool.getMaximumPoolSize, pool.getActiveCount, pool.getQueue.size(), pool.getPoolSize) } @@ -44,13 +44,13 @@ object DispatcherMetricsCollector { case x: Dispatcher ⇒ { val executor = executorServiceMethod.invoke(x) match { case delegate: ExecutorServiceDelegate ⇒ delegate.executor - case other ⇒ other + case other ⇒ other } executor match { - case fjp: ForkJoinPool ⇒ collectForkJoinMetrics(fjp) + case fjp: ForkJoinPool ⇒ collectForkJoinMetrics(fjp) case tpe: ThreadPoolExecutor ⇒ collectExecutorMetrics(tpe) - case anything ⇒ (0L, 0L, 0L, 0L) + case anything ⇒ (0L, 0L, 0L, 0L) } } case _ ⇒ new DispatcherMetrics(0L, 0L, 0L, 0L) |