diff options
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TraceContext.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala index c4c28a68..9555daba 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala @@ -34,6 +34,7 @@ sealed trait TraceContext { def finish(): Unit def origin: TraceContextOrigin def isOpen: Boolean + def isClosed: Boolean = !isOpen def isEmpty: Boolean def nonEmpty: Boolean = !isEmpty def startSegment(segmentName: String, label: String): Segment @@ -111,7 +112,7 @@ class DefaultTraceContext(traceName: String, val token: String, izOpen: Boolean, private def finishSegment(segmentName: String, label: String, duration: Long): Unit = { finishedSegments.add(SegmentData(SegmentMetricIdentity(segmentName, label), duration)) - if (!_isOpen) { + if (isClosed) { metricsExtension.register(TraceMetrics(name), TraceMetrics.Factory).map { traceMetrics ⇒ drainFinishedSegments(traceMetrics) } |