diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 17:20:36 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 18:01:46 +0100 |
commit | c23450f4cc1baa5afdc54aae02b9adb746472381 (patch) | |
tree | 27b48fde7c01d1dbb020a321d845a17cde3b1efb /kamon-core/src/main/scala/kamon/trace | |
parent | 8ac7d1e06be61f53eb90abb4d42b67b476d35317 (diff) | |
download | Kamon-c23450f4cc1baa5afdc54aae02b9adb746472381.tar.gz Kamon-c23450f4cc1baa5afdc54aae02b9adb746472381.tar.bz2 Kamon-c23450f4cc1baa5afdc54aae02b9adb746472381.zip |
= core,play: workaround the non thread safe calls to TrieMap.getOrElseUpdate
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) } |