diff options
-rw-r--r-- | kamon-akka/src/main/scala/kamon/akka/instrumentation/DispatcherInstrumentation.scala | 7 | ||||
-rw-r--r-- | kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/kamon-akka/src/main/scala/kamon/akka/instrumentation/DispatcherInstrumentation.scala b/kamon-akka/src/main/scala/kamon/akka/instrumentation/DispatcherInstrumentation.scala index 0949df47..0d504343 100644 --- a/kamon-akka/src/main/scala/kamon/akka/instrumentation/DispatcherInstrumentation.scala +++ b/kamon-akka/src/main/scala/kamon/akka/instrumentation/DispatcherInstrumentation.scala @@ -19,7 +19,6 @@ package akka.kamon.instrumentation import java.util.concurrent.{ ExecutorService, ThreadPoolExecutor } import akka.actor.{ ActorContext, Props, ActorSystem, ActorSystemImpl } -import akka.dispatch.ForkJoinExecutorConfigurator.AkkaForkJoinPool import akka.dispatch._ import akka.kamon.instrumentation.LookupDataAware.LookupData import kamon.Kamon @@ -29,6 +28,8 @@ import kamon.metric.{ MetricsModule, Entity } import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation._ +import scala.concurrent.forkjoin.ForkJoinPool + @Aspect class DispatcherInstrumentation { @@ -59,7 +60,7 @@ class DispatcherInstrumentation { private def registerDispatcher(dispatcherName: String, executorService: ExecutorService, system: ActorSystem): Unit = executorService match { - case fjp: AkkaForkJoinPool ⇒ + case fjp: ForkJoinPool ⇒ val dispatcherEntity = Entity(system.name + "/" + dispatcherName, AkkaDispatcherMetrics.Category, tags = Map("dispatcher-type" -> "fork-join-pool")) if (Kamon.metrics.shouldTrack(dispatcherEntity)) @@ -128,7 +129,7 @@ class DispatcherInstrumentation { if (lookupData.actorSystem != null) lazyExecutor.asInstanceOf[ExecutorServiceDelegate].executor match { - case fjp: AkkaForkJoinPool ⇒ + case fjp: ForkJoinPool ⇒ lookupData.metrics.removeEntity(Entity(lookupData.actorSystem.name + "/" + lookupData.dispatcherName, AkkaDispatcherMetrics.Category, tags = Map("dispatcher-type" -> "fork-join-pool"))) diff --git a/kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala b/kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala index 91f3cb71..b3bc7623 100644 --- a/kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala +++ b/kamon-core/src/test/scala/kamon/util/executors/ExecutorServiceMetricsSpec.scala @@ -31,7 +31,7 @@ class ExecutorServiceMetricsSpec extends BaseKamonSpec("executor-service-metrics findExecutorRecorder("single-thread-pool") should not be empty ExecutorServiceMetrics.remove("single-thread-pool") - findExecutorRecorder("single-thread-pool") should be (empty) + findExecutorRecorder("single-thread-pool") should be(empty) } "register a ThreadPoolExecutor, collect their metrics and remove it" in { @@ -40,7 +40,7 @@ class ExecutorServiceMetricsSpec extends BaseKamonSpec("executor-service-metrics findExecutorRecorder("thread-pool-executor") should not be empty ExecutorServiceMetrics.remove("thread-pool-executor") - findExecutorRecorder("thread-pool-executor") should be (empty) + findExecutorRecorder("thread-pool-executor") should be(empty) } "register a ScheduledThreadPoolExecutor, collect their metrics and remove it" in { @@ -49,7 +49,7 @@ class ExecutorServiceMetricsSpec extends BaseKamonSpec("executor-service-metrics findExecutorRecorder("scheduled-thread-pool-executor") should not be empty ExecutorServiceMetrics.remove("scheduled-thread-pool-executor") - findExecutorRecorder("scheduled-thread-pool-executor") should be (empty) + findExecutorRecorder("scheduled-thread-pool-executor") should be(empty) } "register a Java ForkJoinPool, collect their metrics and remove it" in { @@ -58,7 +58,7 @@ class ExecutorServiceMetricsSpec extends BaseKamonSpec("executor-service-metrics findExecutorRecorder("java-fork-join-pool") should not be empty ExecutorServiceMetrics.remove("java-fork-join-pool") - findExecutorRecorder("java-fork-join-pool") should be (empty) + findExecutorRecorder("java-fork-join-pool") should be(empty) } "register a Scala ForkJoinPool, collect their metrics and remove it" in { @@ -67,7 +67,7 @@ class ExecutorServiceMetricsSpec extends BaseKamonSpec("executor-service-metrics findExecutorRecorder("scala-fork-join-pool") should not be empty ExecutorServiceMetrics.remove("scala-fork-join-pool") - findExecutorRecorder("scala-fork-join-pool") should be (empty) + findExecutorRecorder("scala-fork-join-pool") should be(empty) } def findExecutorRecorder(name: String): Option[EntityRecorder] = |