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-play/src/main/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-play/src/main/scala')
-rw-r--r-- | kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala b/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala index ca95781e..989ef43e 100644 --- a/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala +++ b/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala @@ -92,7 +92,7 @@ class RequestInstrumentation { } object RequestInstrumentation { - + import kamon.metric.Metrics.AtomicGetOrElseUpdateForTriemap import java.util.Locale import scala.collection.concurrent.TrieMap @@ -100,7 +100,7 @@ object RequestInstrumentation { def normaliseTraceName(requestHeader: RequestHeader): Option[String] = requestHeader.tags.get(Routes.ROUTE_VERB).map({ verb ⇒ val path = requestHeader.tags(Routes.ROUTE_PATTERN) - cache.getOrElseUpdate(s"$verb$path", { + cache.atomicGetOrElseUpdate(s"$verb$path", { val traceName = { // Convert paths of form GET /foo/bar/$paramname<regexp>/blah to foo.bar.paramname.blah.get val p = path.replaceAll("""\$([^<]+)<[^>]+>""", "$1").replace('/', '.').dropWhile(_ == '.') |