aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2014-05-20 20:42:41 -0300
committerDiego <diegolparra@gmail.com>2014-05-20 20:46:43 -0300
commit40073266ed7ed69ae0e42801201dc818b59726fb (patch)
tree91cf99b9814e968b3a84815df40d56063d895c4e /kamon-core/src/main/scala
parentf40f19a719d35873e4e0ab599f783f860876f51d (diff)
downloadKamon-40073266ed7ed69ae0e42801201dc818b59726fb.tar.gz
Kamon-40073266ed7ed69ae0e42801201dc818b59726fb.tar.bz2
Kamon-40073266ed7ed69ae0e42801201dc818b59726fb.zip
+ core: added tests to dispatcher metrics
Diffstat (limited to 'kamon-core/src/main/scala')
-rw-r--r--kamon-core/src/main/scala/kamon/metrics/dispatcher/DispatcherMetricsCollector.scala14
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)