diff options
Diffstat (limited to 'kamon-core/src/main')
-rw-r--r-- | kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala b/kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala index 732e189e..a4bca570 100644 --- a/kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala +++ b/kamon-core/src/main/scala/kamon/util/executors/ExecutorMetricRecorder.scala @@ -1,6 +1,6 @@ /* * ========================================================================================= - * Copyright © 2013-2015 the kamon project <http://kamon.io/> + * Copyright © 2013-2016 the kamon project <http://kamon.io/> * * 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 @@ -23,7 +23,7 @@ import kamon.util.executors.ForkJoinPools.ForkJoinMetrics import scala.concurrent.forkjoin.ForkJoinPool -object ForkJoinPools { +object ForkJoinPools extends ForkJoinLowPriority { trait ForkJoinMetrics[T] { def getParallelism(fjp: T): Long def getPoolSize(fjp: T): Long @@ -33,16 +33,6 @@ object ForkJoinPools { def getQueuedSubmissionCount(fjp: T): Long } - implicit object ScalaForkJoin extends ForkJoinMetrics[ForkJoinPool] { - def getParallelism(fjp: ForkJoinPool) = fjp.getParallelism - def getPoolSize(fjp: ForkJoinPool) = fjp.getPoolSize.toLong - def getRunningThreadCount(fjp: ForkJoinPool) = fjp.getActiveThreadCount.toLong - def getActiveThreadCount(fjp: ForkJoinPool) = fjp.getRunningThreadCount.toLong - def getQueuedTaskCount(fjp: ForkJoinPool) = fjp.getQueuedTaskCount - def getQueuedSubmissionCount(fjp: ForkJoinPool) = fjp.getQueuedSubmissionCount - - } - implicit object JavaForkJoin extends ForkJoinMetrics[JavaForkJoinPool] { def getParallelism(fjp: JavaForkJoinPool) = fjp.getParallelism def getPoolSize(fjp: JavaForkJoinPool) = fjp.getPoolSize.toLong @@ -50,7 +40,17 @@ object ForkJoinPools { def getActiveThreadCount(fjp: JavaForkJoinPool) = fjp.getRunningThreadCount.toLong def getQueuedTaskCount(fjp: JavaForkJoinPool) = fjp.getQueuedTaskCount def getQueuedSubmissionCount(fjp: JavaForkJoinPool) = fjp.getQueuedSubmissionCount + } +} +trait ForkJoinLowPriority { + implicit object ScalaForkJoin extends ForkJoinMetrics[ForkJoinPool] { + def getParallelism(fjp: ForkJoinPool) = fjp.getParallelism + def getPoolSize(fjp: ForkJoinPool) = fjp.getPoolSize.toLong + def getRunningThreadCount(fjp: ForkJoinPool) = fjp.getActiveThreadCount.toLong + def getActiveThreadCount(fjp: ForkJoinPool) = fjp.getRunningThreadCount.toLong + def getQueuedTaskCount(fjp: ForkJoinPool) = fjp.getQueuedTaskCount + def getQueuedSubmissionCount(fjp: ForkJoinPool) = fjp.getQueuedSubmissionCount } } @@ -96,4 +96,4 @@ object ThreadPoolExecutorMetrics { def category: String = cat def createRecorder(instrumentFactory: InstrumentFactory) = new ThreadPoolExecutorMetrics(tpe, instrumentFactory) } -}
\ No newline at end of file +} |