diff options
Diffstat (limited to 'kamon-core/src/main')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala b/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala index 187eb07d..c506fe81 100644 --- a/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala +++ b/kamon-core/src/main/scala/kamon/metric/TraceMetrics.scala @@ -69,8 +69,8 @@ object TraceMetrics extends MetricGroupCategory { val segmentConfig = settings.getConfig("segment") new TraceMetricRecorder( - Histogram.fromConfig(elapsedTimeConfig), - () ⇒ Histogram.fromConfig(segmentConfig)) + Histogram.fromConfig(elapsedTimeConfig, Scale.Nano), + () ⇒ Histogram.fromConfig(segmentConfig, Scale.Nano)) } } diff --git a/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala b/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala index 9ce11f49..7d8022f7 100644 --- a/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala +++ b/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala @@ -78,6 +78,17 @@ object Histogram { def recordsIterator: Iterator[Record] def merge(that: Histogram.Snapshot, context: CollectionContext): Histogram.Snapshot } + + object Snapshot { + def empty(targetScale: Scale) = new Snapshot { + override def min: Long = 0L + override def max: Long = 0L + override def recordsIterator: Iterator[Record] = Iterator.empty + override def merge(that: Snapshot, context: CollectionContext): Snapshot = that + override def scale: Scale = targetScale + override def numberOfMeasurements: Long = 0L + } + } } /** |