diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-12-12 15:00:59 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-12-13 00:48:38 +0100 |
commit | 686040cb569283667b967494be4a7088ef35964c (patch) | |
tree | 95873e59bad8c859a14f55a1cc42758c87901d26 /kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala | |
parent | 66cf166772712267aac922c51ded90c7dec3bdd5 (diff) | |
download | Kamon-686040cb569283667b967494be4a7088ef35964c.tar.gz Kamon-686040cb569283667b967494be4a7088ef35964c.tar.bz2 Kamon-686040cb569283667b967494be4a7088ef35964c.zip |
use a specialized java.time.Clock exposed through the Kamon companion object
Diffstat (limited to 'kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala')
-rw-r--r-- | kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala b/kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala index b43b7509..6ff6a0a0 100644 --- a/kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala +++ b/kamon-testkit/src/main/scala/kamon/testkit/SpanInspection.scala @@ -15,6 +15,7 @@ package kamon.testkit +import kamon.Kamon import kamon.trace.{Span, SpanContext} import kamon.trace.Span.FinishedSpan import kamon.util.Clock @@ -34,9 +35,10 @@ object SpanInspection { private val (realSpan, spanData) = Try { val realSpan = span match { case _: Span.Local => span + case other => sys.error(s"Only Span.Local can be inspected but got [${other.getClass.getName}]" ) } - val spanData = invoke[Span.Local, FinishedSpan](realSpan, "toFinishedSpan", classOf[Long] -> Long.box(Clock.microTimestamp())) + val spanData = invoke[Span.Local, FinishedSpan](realSpan, "toFinishedSpan", classOf[Long] -> Long.box(Kamon.clock().micros())) (realSpan, spanData) }.getOrElse((null, null)) |