diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-07 11:25:08 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-07 11:25:08 -0300 |
commit | 1e6665e30d96772eab92aca4d23e176adcd88dc5 (patch) | |
tree | dfbeb7cf71ac6a67345f1d9eaec903a7023c32e8 /src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala | |
parent | a9f568f562e1c4a358a3f63b3dcce2b38b5e14d6 (diff) | |
download | Kamon-1e6665e30d96772eab92aca4d23e176adcd88dc5.tar.gz Kamon-1e6665e30d96772eab92aca4d23e176adcd88dc5.tar.bz2 Kamon-1e6665e30d96772eab92aca4d23e176adcd88dc5.zip |
upgraded to akka 2.2
Diffstat (limited to 'src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala')
-rw-r--r-- | src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala b/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala index 6677f0f7..7398a2bd 100644 --- a/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala +++ b/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala @@ -4,7 +4,7 @@ import org.aspectj.lang.annotation._ import org.aspectj.lang.ProceedingJoinPoint import akka.actor.{Props, ActorSystem, ActorRef} import kamon.{Kamon, TraceContext} -import akka.dispatch.Envelope +import akka.dispatch.{MessageDispatcher, Envelope} import com.codahale.metrics.{Timer, ExponentiallyDecayingReservoir, Histogram} import kamon.metric.{MetricDirectory, Metrics} import com.codahale.metrics @@ -38,11 +38,13 @@ class ActorCellInvokeInstrumentation { var processingTimeTimer: Timer = _ var shouldTrack = false - @Pointcut("execution(akka.actor.ActorCell.new(..)) && args(system, ref, props, parent)") - def actorCellCreation(system: ActorSystem, ref: ActorRef, props: Props, parent: ActorRef): Unit = {} + // AKKA 2.2 introduces the dispatcher parameter. Maybe we could provide a dual pointcut. - @After("actorCellCreation(system, ref, props, parent)") - def registerMetricsInRegistry(system: ActorSystem, ref: ActorRef, props: Props, parent: ActorRef): Unit = { + @Pointcut("execution(akka.actor.ActorCell.new(..)) && args(system, ref, props, dispatcher, parent)") + def actorCellCreation(system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = {} + + @After("actorCellCreation(system, ref, props, dispatcher, parent)") + def registerMetricsInRegistry(system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = { val actorName = MetricDirectory.nameForActor(ref) val histogramName = MetricDirectory.nameForMailbox(system.name, actorName) @@ -73,6 +75,7 @@ class ActorCellInvokeInstrumentation { ctx match { case Some(c) => { Kamon.set(c) + //println("ENVELOPE ORIGINAL:---------------->"+originalEnvelope) pjp.proceedWith(originalEnvelope) Kamon.clear } |