aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/akka
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2014-04-30 00:35:07 -0300
committerDiego <diegolparra@gmail.com>2014-04-30 00:35:07 -0300
commit77bb479f2b839d148e2f05f8911bae94f3170df1 (patch)
treebff192e95d0d67cb2dc2bedfaf243b7bb4b61836 /kamon-core/src/main/scala/akka
parent55ae74d503a3b8dd6c341586668259e3ca62a8d6 (diff)
downloadKamon-77bb479f2b839d148e2f05f8911bae94f3170df1.tar.gz
Kamon-77bb479f2b839d148e2f05f8911bae94f3170df1.tar.bz2
Kamon-77bb479f2b839d148e2f05f8911bae94f3170df1.zip
! core: new counter recorder based on LongAdder
Diffstat (limited to 'kamon-core/src/main/scala/akka')
-rw-r--r--kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala13
1 files changed, 12 insertions, 1 deletions
diff --git a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala
index e52a66b2..ae9d20f6 100644
--- a/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala
+++ b/kamon-core/src/main/scala/akka/instrumentation/ActorMessagePassingTracing.scala
@@ -24,6 +24,7 @@ import kamon.metrics.{ ActorMetrics, Metrics }
import kamon.Kamon
import kamon.metrics.ActorMetrics.ActorMetricRecorder
import java.util.concurrent.atomic.AtomicInteger
+import kamon.metrics.instruments.Counter
@Aspect
class BehaviourInvokeTracing {
@@ -32,7 +33,7 @@ class BehaviourInvokeTracing {
def actorCellCreation(cell: ActorCell, system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = {}
@After("actorCellCreation(cell, system, ref, props, dispatcher, parent)")
- def afterCreation(cell: ActorCell, system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = {
+ def afterCreation(cell: ActorCellMetrics, system: ActorSystem, ref: ActorRef, props: Props, dispatcher: MessageDispatcher, parent: ActorRef): Unit = {
val metricsExtension = Kamon(Metrics)(system)
val metricIdentity = ActorMetrics(ref.path.elements.mkString("/"))
val cellWithMetrics = cell.asInstanceOf[ActorCellMetrics]
@@ -89,6 +90,16 @@ class BehaviourInvokeTracing {
val cellWithMetrics = cell.asInstanceOf[ActorCellMetrics]
cellWithMetrics.actorMetricsRecorder.map(p ⇒ Kamon(Metrics)(cell.system).unregister(cellWithMetrics.metricIdentity))
}
+
+ @Pointcut("execution(* akka.actor.ActorCell.handleInvokeFailure(..)) && this(cell)")
+ def actorInvokeFailure(cell: ActorCellMetrics): Unit = {}
+
+ @Before("actorInvokeFailure(cell)")
+ def beforeInvokeFailure(cell: ActorCellMetrics): Unit = {
+ cell.actorMetricsRecorder.map {
+ am ⇒ am.errorCounter.record(1L)
+ }
+ }
}
trait ActorCellMetrics {