From 5d296a16270b1ec66d206ef1195208ea864f49c1 Mon Sep 17 00:00:00 2001 From: Ivan Topolnak Date: Mon, 3 Feb 2014 18:10:08 -0300 Subject: create the notion of a metric group category for easier filtering when subscribing --- .../scala/akka/instrumentation/ActorMessagePassingTracing.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kamon-core/src/main/scala/akka') diff --git a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala index 199b2bb2..6762fb10 100644 --- a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala +++ b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala @@ -27,7 +27,7 @@ import kamon.metrics.ActorMetrics.ActorMetricRecorder @Aspect("perthis(actorCellCreation(*, *, *, *, *))") class BehaviourInvokeTracing { - var path: String = _ + var metricIdentity: ActorMetrics = _ var actorMetrics: Option[ActorMetricRecorder] = None @Pointcut("execution(akka.actor.ActorCell.new(..)) && args(system, ref, props, dispatcher, parent)") @@ -37,8 +37,8 @@ class BehaviourInvokeTracing { def afterCreation(system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = { val metricsExtension = Kamon(Metrics)(system) - path = ref.path.elements.mkString("/") - actorMetrics = metricsExtension.register(path, ActorMetrics) + metricIdentity = ActorMetrics(ref.path.elements.mkString("/")) + actorMetrics = metricsExtension.register(metricIdentity, ActorMetrics.Factory) } @Pointcut("(execution(* akka.actor.ActorCell.invoke(*)) || execution(* akka.routing.RoutedActorCell.sendMessage(*))) && this(cell) && args(envelope)") @@ -65,7 +65,7 @@ class BehaviourInvokeTracing { @After("actorStop(cell)") def afterStop(cell: Cell): Unit = { - actorMetrics.map(p ⇒ Kamon(Metrics)(cell.system).unregister(path, ActorMetrics)) + actorMetrics.map(p ⇒ Kamon(Metrics)(cell.system).unregister(metricIdentity)) } } -- cgit v1.2.3