diff options
Diffstat (limited to 'kamon-core/src/main/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 = {} |