diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-05-25 16:52:52 +0200 |
commit | a3d78ef61a277b0b62dc93daf84756dfa7625d3d (patch) | |
tree | 4fee7ce93ecfb4e32c7aaaa22efb75ed07c667f6 /kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala | |
parent | 22379d3f318b2cd3a4c995ff1c45bda33d935a46 (diff) | |
download | Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.gz Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.tar.bz2 Kamon-a3d78ef61a277b0b62dc93daf84756dfa7625d3d.zip |
trying to flatten out the structure and eliminate the notion of entitites
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala | 13 |
1 files changed, 7 insertions, 6 deletions
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 76d4ab65..29fe8c69 100644 --- a/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala +++ b/kamon-core/src/main/scala/kamon/metric/instrument/Histogram.scala @@ -1,9 +1,10 @@ -package kamon.metric.instrument +package kamon +package metric +package instrument import java.nio.ByteBuffer import com.typesafe.scalalogging.StrictLogging -import kamon.metric.Entity import kamon.util.MeasurementUnit import org.HdrHistogram.{AtomicHistogramExtension, ZigZag} @@ -16,8 +17,8 @@ trait Histogram { } -class HdrHistogram(entity: Entity, name: String, val measurementUnit: MeasurementUnit, val dynamicRange: DynamicRange) - extends AtomicHistogramExtension(dynamicRange) with Histogram with DistributionSnapshotInstrument with StrictLogging { +class HdrHistogram(name: String, tags: Map[String, String], val measurementUnit: MeasurementUnit, val dynamicRange: DynamicRange) + extends AtomicHistogramExtension(dynamicRange) with SnapshotableHistogram with StrictLogging { def record(value: Long): Unit = tryRecord(value, 1) @@ -30,7 +31,7 @@ class HdrHistogram(entity: Entity, name: String, val measurementUnit: Measuremen recordValueWithCount(value, count) } catch { case anyException: Throwable ⇒ - logger.warn(s"Failed to store value [$value] in histogram [$name] of entity [$entity]. You might need to change " + + logger.warn(s"Failed to store value [$value] in histogram [$name]. You might need to change " + "your dynamic range configuration for this instrument.", anyException) } } @@ -81,7 +82,7 @@ class HdrHistogram(entity: Entity, name: String, val measurementUnit: Measuremen val distribution = new ZigZagCountsDistribution(totalCount, minIndex, maxIndex, ByteBuffer.wrap(zigZagCounts), protectedUnitMagnitude(), protectedSubBucketHalfCount(), protectedSubBucketHalfCountMagnitude()) - DistributionSnapshot(name, measurementUnit, dynamicRange, distribution) + DistributionSnapshot(name, tags, measurementUnit, dynamicRange, distribution) } private class ZigZagCountsDistribution(val count: Long, minIndex: Int, maxIndex: Int, zigZagCounts: ByteBuffer, |