diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-04-06 01:35:08 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-04-06 01:35:08 +0200 |
commit | 1329961963114642bb20bd9cf108713771f94bfc (patch) | |
tree | 9c80cd7c5be51f105466df36460834feec6e7414 | |
parent | 0746f0002b2e1d563d837f954b367ae063546ca1 (diff) | |
download | Kamon-1329961963114642bb20bd9cf108713771f94bfc.tar.gz Kamon-1329961963114642bb20bd9cf108713771f94bfc.tar.bz2 Kamon-1329961963114642bb20bd9cf108713771f94bfc.zip |
= akka: cleanup the dispatcher metric recorders.
-rw-r--r-- | kamon-akka/src/main/scala/kamon/akka/DispatcherMetrics.scala | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/kamon-akka/src/main/scala/kamon/akka/DispatcherMetrics.scala b/kamon-akka/src/main/scala/kamon/akka/DispatcherMetrics.scala index acf92e70..23ecde79 100644 --- a/kamon-akka/src/main/scala/kamon/akka/DispatcherMetrics.scala +++ b/kamon-akka/src/main/scala/kamon/akka/DispatcherMetrics.scala @@ -26,21 +26,10 @@ class ForkJoinPoolDispatcherMetrics(fjp: AkkaForkJoinPool, instrumentFactory: In val paralellism = minMaxCounter("parallelism") paralellism.increment(fjp.getParallelism) // Steady value. - val poolSize = gauge("pool-size", () ⇒ { - fjp.getPoolSize.toLong - }) - - val activeThreads = gauge("active-threads", () ⇒ { - fjp.getActiveThreadCount.toLong - }) - - val runningThreads = gauge("running-threads", () ⇒ { - fjp.getRunningThreadCount.toLong - }) - - val queuedTaskCount = gauge("queued-task-count", () ⇒ { - fjp.getQueuedTaskCount - }) + val poolSize = gauge("pool-size", fjp.getPoolSize.toLong) + val activeThreads = gauge("active-threads", fjp.getActiveThreadCount.toLong) + val runningThreads = gauge("running-threads", fjp.getRunningThreadCount.toLong) + val queuedTaskCount = gauge("queued-task-count", fjp.getQueuedTaskCount) } object ForkJoinPoolDispatcherMetrics { @@ -52,29 +41,16 @@ object ForkJoinPoolDispatcherMetrics { } class ThreadPoolExecutorDispatcherMetrics(tpe: ThreadPoolExecutor, instrumentFactory: InstrumentFactory) extends GenericEntityRecorder(instrumentFactory) { - val corePoolSize = gauge("core-pool-size", () ⇒ { - tpe.getCorePoolSize.toLong - }) - - val maxPoolSize = gauge("max-pool-size", () ⇒ { - tpe.getMaximumPoolSize.toLong - }) - - val poolSize = gauge("pool-size", () ⇒ { - tpe.getPoolSize.toLong - }) - - val activeThreads = gauge("active-threads", () ⇒ { - tpe.getActiveCount.toLong - }) - + val corePoolSize = gauge("core-pool-size", tpe.getCorePoolSize.toLong) + val maxPoolSize = gauge("max-pool-size", tpe.getMaximumPoolSize.toLong) + val poolSize = gauge("pool-size", tpe.getPoolSize.toLong) + val activeThreads = gauge("active-threads", tpe.getActiveCount.toLong) val processedTasks = gauge("processed-tasks", DifferentialValueCollector(() ⇒ { tpe.getTaskCount })) } object ThreadPoolExecutorDispatcherMetrics { - def factory(tpe: ThreadPoolExecutor) = new EntityRecorderFactory[ThreadPoolExecutorDispatcherMetrics] { def category: String = AkkaDispatcherMetrics.Category def createRecorder(instrumentFactory: InstrumentFactory) = new ThreadPoolExecutorDispatcherMetrics(tpe, instrumentFactory) |