diff options
Diffstat (limited to 'kamon-core/src/test/scala/kamon/testkit')
-rw-r--r-- | kamon-core/src/test/scala/kamon/testkit/SpanInspector.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kamon-core/src/test/scala/kamon/testkit/SpanInspector.scala b/kamon-core/src/test/scala/kamon/testkit/SpanInspector.scala index 3ef1012b..e00c8b26 100644 --- a/kamon-core/src/test/scala/kamon/testkit/SpanInspector.scala +++ b/kamon-core/src/test/scala/kamon/testkit/SpanInspector.scala @@ -8,7 +8,7 @@ import scala.reflect.ClassTag import scala.util.Try class SpanInspector(span: Span) { - private val (realSpan, spanData) = { + private val (realSpan, spanData) = Try { val realSpan = span match { case _: Span.Real => span case a: ActiveSpan => @@ -17,10 +17,10 @@ class SpanInspector(span: Span) { val spanData = invoke[Span.Real, FinishedSpan](realSpan, "toFinishedSpan", classOf[Long] -> Long.box(Clock.microTimestamp())) (realSpan, spanData) - } + }.getOrElse((null, null)) - def nonEmpty: Boolean = - !span.isInstanceOf[Span.Empty] + def isEmpty: Boolean = + realSpan == null def spanTag(key: String): Option[Span.TagValue] = spanData.tags.get(key) |