diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 17:39:14 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 18:01:46 +0100 |
commit | f4bf6a7cd5da723607fb2a3c5f98a5e56d7b0be7 (patch) | |
tree | 6e8487822f0a2d730b08499f5be8d400b9e1708c /kamon-core/src/main/scala/kamon/metric | |
parent | 88bc1b94b2d737e01074a8f41391367f59796157 (diff) | |
download | Kamon-f4bf6a7cd5da723607fb2a3c5f98a5e56d7b0be7.tar.gz Kamon-f4bf6a7cd5da723607fb2a3c5f98a5e56d7b0be7.tar.bz2 Kamon-f4bf6a7cd5da723607fb2a3c5f98a5e56d7b0be7.zip |
= core,spray,newrelic: minor formatting changes.
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala | 8 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala b/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala index cc7eb5f0..ed55ab06 100644 --- a/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala +++ b/kamon-core/src/main/scala/kamon/metric/MetricsExtension.scala @@ -48,7 +48,7 @@ class MetricsExtension(system: ExtendedActorSystem) extends Kamon.Extension { def register(identity: MetricGroupIdentity, factory: MetricGroupFactory): Option[factory.GroupRecorder] = { if (shouldTrack(identity)) - Some(storage.atomicGetOrElseUpdate(identity, factory.create(metricsExtConfig, system)).asInstanceOf[factory.GroupRecorder]) + Some(storage.atomicGetOrElseUpdate(identity, factory.create(metricsExtConfig, system)).asInstanceOf[factory.GroupRecorder]) else None } @@ -135,10 +135,10 @@ object Metrics extends ExtensionId[MetricsExtension] with ExtensionIdProvider { } implicit class AtomicGetOrElseUpdateForTriemap[K, V](trieMap: TrieMap[K, V]) { - def atomicGetOrElseUpdate(key: K, op: => V): V = + def atomicGetOrElseUpdate(key: K, op: ⇒ V): V = trieMap.get(key) match { - case Some(v) => v - case None => val d = op; trieMap.putIfAbsent(key, d).getOrElse(d) + case Some(v) ⇒ v + case None ⇒ val d = op; trieMap.putIfAbsent(key, d).getOrElse(d) } } } diff --git a/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala b/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala index 4c5ad6ce..eaad6e0d 100644 --- a/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala +++ b/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala @@ -39,7 +39,7 @@ object TraceMetrics extends MetricGroupCategory { val segments = TrieMap[MetricIdentity, Histogram]() def segmentRecorder(segmentIdentity: MetricIdentity): Histogram = - segments.atomicGetOrElseUpdate(segmentIdentity, segmentRecorderFactory.apply()) + segments.atomicGetOrElseUpdate(segmentIdentity, segmentRecorderFactory.apply()) def collect(context: CollectionContext): TraceMetricsSnapshot = TraceMetricsSnapshot( @@ -55,7 +55,7 @@ object TraceMetrics extends MetricGroupCategory { type GroupSnapshotType = TraceMetricsSnapshot def merge(that: TraceMetricsSnapshot, context: CollectionContext): TraceMetricsSnapshot = - TraceMetricsSnapshot(elapsedTime.merge(that.elapsedTime, context), combineMaps(segments, that.segments)((l, r) => l.merge(r, context))) + TraceMetricsSnapshot(elapsedTime.merge(that.elapsedTime, context), combineMaps(segments, that.segments)((l, r) ⇒ l.merge(r, context))) def metrics: Map[MetricIdentity, MetricSnapshot] = segments + (ElapsedTime -> elapsedTime) } |