diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-03-24 00:27:02 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-03-24 00:27:02 -0300 |
commit | f6e9cb16798abf5eecada300df44339d3f09592d (patch) | |
tree | d7c47b891a11959681f3e5688c42314133dcac19 /kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala | |
parent | b0c40681d8d6a7f5096fd6d70f37eda23336b0a6 (diff) | |
download | Kamon-f6e9cb16798abf5eecada300df44339d3f09592d.tar.gz Kamon-f6e9cb16798abf5eecada300df44339d3f09592d.tar.bz2 Kamon-f6e9cb16798abf5eecada300df44339d3f09592d.zip |
record mailbox size when sending a message to an actor
Diffstat (limited to 'kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala')
-rw-r--r-- | kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala index 60266461..dcdf6f94 100644 --- a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala +++ b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala @@ -60,6 +60,17 @@ class BehaviourInvokeTracing { } } + @Pointcut("execution(* akka.actor.ActorCell.sendMessage(*)) && this(cell)") + def sendingMessageToActorCell(cell: ActorCell): Unit = {} + + @After("sendingMessageToActorCell(cell)") + def afterSendMessageToActorCell(cell: ActorCell): Unit = { + val cellWithMetrics = cell.asInstanceOf[ActorCellMetrics] + cellWithMetrics.actorMetricsRecorder.map { am ⇒ + am.mailboxSize.record(cell.numberOfMessages) + } + } + @Pointcut("execution(* akka.actor.ActorCell.stop()) && this(cell)") def actorStop(cell: ActorCell): Unit = {} |