diff options
author | Diego <diegolparra@gmail.com> | 2014-05-09 18:23:21 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-05-09 18:23:21 -0300 |
commit | e8c9f06627968c21b0414d428999de17854a460f (patch) | |
tree | 96217d3d25c27e15f32e0d5f2da3dbd5241c394d /kamon-core | |
parent | 03c2885b566e8bf38f6242a205cd1077b7a7d41c (diff) | |
download | Kamon-e8c9f06627968c21b0414d428999de17854a460f.tar.gz Kamon-e8c9f06627968c21b0414d428999de17854a460f.tar.bz2 Kamon-e8c9f06627968c21b0414d428999de17854a460f.zip |
+ play: removed default dispatchers to kamon default dispatcher and refactor test in WSInstrumentationSpec
Diffstat (limited to 'kamon-core')
-rw-r--r-- | kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala index 13e506e2..d002c574 100644 --- a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala +++ b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala @@ -44,8 +44,6 @@ class BehaviourInvokeTracing { cellWithMetrics.metricIdentity = metricIdentity cellWithMetrics.actorMetricsRecorder = metricsExtension.register(metricIdentity, ActorMetrics.Factory) - val executor = Contexts.lookupExecutionContext(Contexts.kamonDefaultDispatcher)(system) - system.scheduler.schedule(0 milliseconds, 100 milliseconds) { cellWithMetrics.actorMetricsRecorder.map { am ⇒ @@ -56,7 +54,7 @@ class BehaviourInvokeTracing { record(max) record(sum) } - }(executor) + }(metricsExtension.defaultDispatcher) } @Pointcut("(execution(* akka.actor.ActorCell.invoke(*)) || execution(* akka.routing.RoutedActorCell.sendMessage(*))) && this(cell) && args(envelope)") diff --git a/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala b/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala index 359540fc..9a08da71 100644 --- a/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala +++ b/kamon-core/src/main/scala/kamon/metrics/MetricsExtension.scala @@ -19,7 +19,7 @@ package kamon.metrics import scala.collection.concurrent.TrieMap import akka.actor._ import com.typesafe.config.Config -import kamon.util.GlobPathFilter +import kamon.util.{ Contexts, GlobPathFilter } import kamon.Kamon import akka.actor import kamon.metrics.Metrics.MetricGroupFilter @@ -76,6 +76,7 @@ class MetricsExtension(system: ExtendedActorSystem) extends Kamon.Extension { allFilters.toMap } + val defaultDispatcher = Contexts.lookupExecutionContext(Contexts.kamonDefaultDispatcher)(system) } object Metrics extends ExtensionId[MetricsExtension] with ExtensionIdProvider { |