diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2013-11-25 02:39:24 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2013-11-25 02:39:24 -0300 |
commit | bc24dc67a0e0bacf62ef040d991b25d28e4c4a2b (patch) | |
tree | c3d80642d22bfbb27b98d20e7e6631a45f79efb0 /kamon-trace/src/main/scala/kamon/trace/instrumentation | |
parent | 0ffbf436a7d9d69c2292c9892e740b592dc8d85e (diff) | |
download | Kamon-bc24dc67a0e0bacf62ef040d991b25d28e4c4a2b.tar.gz Kamon-bc24dc67a0e0bacf62ef040d991b25d28e4c4a2b.tar.bz2 Kamon-bc24dc67a0e0bacf62ef040d991b25d28e4c4a2b.zip |
relocate ask pattern tracing
Diffstat (limited to 'kamon-trace/src/main/scala/kamon/trace/instrumentation')
-rw-r--r-- | kamon-trace/src/main/scala/kamon/trace/instrumentation/AskPatternTracing.scala | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/kamon-trace/src/main/scala/kamon/trace/instrumentation/AskPatternTracing.scala b/kamon-trace/src/main/scala/kamon/trace/instrumentation/AskPatternTracing.scala deleted file mode 100644 index 625ed1ae..00000000 --- a/kamon-trace/src/main/scala/kamon/trace/instrumentation/AskPatternTracing.scala +++ /dev/null @@ -1,34 +0,0 @@ -package akka.pattern.tracing - -import org.aspectj.lang.annotation.{After, AfterReturning, Pointcut, Aspect} -import akka.pattern.{AskTimeoutException, PromiseActorRef} -import akka.event.Logging.Warning -import scala.compat.Platform.EOL -import akka.actor.ActorRefProvider - -@Aspect -class AskPatternTracing { - - class StackTraceCaptureException extends Throwable - - @Pointcut(value = "execution(* akka.pattern.PromiseActorRef$.apply(..)) && args(provider, *)", argNames = "provider") - def promiseActorRefApply(provider: ActorRefProvider): Unit = { - provider.settings.config.getBoolean("kamon.trace.ask-pattern-tracing") - } - - @AfterReturning(pointcut = "promiseActorRefApply(provider)", returning = "promiseActor") - def hookAskTimeoutWarning(provider: ActorRefProvider, promiseActor: PromiseActorRef): Unit = { - val future = promiseActor.result.future - val system = promiseActor.provider.guardian.underlying.system - implicit val ec = system.dispatcher - val stack = new StackTraceCaptureException - - future onFailure { - case timeout: AskTimeoutException => - val stackString = stack.getStackTrace.drop(3).mkString("", EOL, EOL) - - system.eventStream.publish(Warning("AskPatternTracing", classOf[AskPatternTracing], - "Timeout triggered for ask pattern registered at: " + stackString)) - } - } -} |