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 | 88bc1b94b2d737e01074a8f41391367f59796157 (patch) | |
tree | cd31ef5e5573f4b7d1ef55961cbd9208901c70fa /kamon-core/src/main/scala/kamon/trace/TraceContext.scala | |
parent | ef21f8d0ade1015f71f1d289c8d041e2b525d824 (diff) | |
download | Kamon-88bc1b94b2d737e01074a8f41391367f59796157.tar.gz Kamon-88bc1b94b2d737e01074a8f41391367f59796157.tar.bz2 Kamon-88bc1b94b2d737e01074a8f41391367f59796157.zip |
= core,play: workaround the non thread safe calls to TrieMap.getOrElseUpdate
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace/TraceContext.scala')
-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) } |