diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-12 02:26:09 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-12 02:26:09 +0200 |
commit | 109ba0e17bf6d5ffbcf784e808fbb8e8f3d32a8c (patch) | |
tree | ae78312985700c2b411f027baeb073e43daece84 /kamon-playground | |
parent | 30cd0ea7634615f55314c56b76fd000a52af8449 (diff) | |
download | Kamon-109ba0e17bf6d5ffbcf784e808fbb8e8f3d32a8c.tar.gz Kamon-109ba0e17bf6d5ffbcf784e808fbb8e8f3d32a8c.tar.bz2 Kamon-109ba0e17bf6d5ffbcf784e808fbb8e8f3d32a8c.zip |
= core: fix NPE when finishing segments, fixes #88
Diffstat (limited to 'kamon-playground')
-rw-r--r-- | kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala index 1db2db67..b6bcc677 100644 --- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala @@ -21,6 +21,7 @@ import akka.routing.RoundRobinPool import akka.util.Timeout import kamon.Kamon import kamon.metric.Subscriptions.TickMetricSnapshot +import kamon.metric.TraceMetrics.HttpClientRequest import kamon.metric._ import kamon.spray.KamonTraceDirectives import kamon.trace.TraceRecorder @@ -124,6 +125,16 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil throw new NullPointerException "okk" } + } ~ + path("segment") { + complete { + val segment = TraceRecorder.startSegment(HttpClientRequest("hello-world")) + (replier ? "hello").mapTo[String].onComplete { t => + segment.get.finish() + } + + "segment" + } } } } @@ -166,7 +177,7 @@ class Replier extends Actor with ActorLogging { if (TraceRecorder.currentContext.isEmpty) log.warning("PROCESSING A MESSAGE WITHOUT CONTEXT") - log.info("Processing at the Replier, and self is: {}", self) + //log.info("Processing at the Replier, and self is: {}", self) sender ! anything } } |