diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-27 20:33:38 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-27 20:33:38 -0300 |
commit | 90202659d0385da0797af516471808751f05c935 (patch) | |
tree | 3aa0658527450579aab68622433f509999556679 /kamon-core/src | |
parent | 8f95e9da907924dc89b8348826f52c1991cb662c (diff) | |
download | Kamon-90202659d0385da0797af516471808751f05c935.tar.gz Kamon-90202659d0385da0797af516471808751f05c935.tar.bz2 Kamon-90202659d0385da0797af516471808751f05c935.zip |
= newrelic: upgrade to the latest metrics scheme, closes #54
Diffstat (limited to 'kamon-core/src')
-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 + } + } } /** |