aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-04-28 14:56:02 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2017-04-28 15:00:06 +0200
commitf24c1a7a4b96dcfb2609c6f512f34dd6d54de439 (patch)
tree9e32bb0018a8c708e2dd33d5c30cd6786ed48731 /kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala
parentf5e70695ad0124cd5cd648d186d5174c7b121266 (diff)
downloadKamon-f24c1a7a4b96dcfb2609c6f512f34dd6d54de439.tar.gz
Kamon-f24c1a7a4b96dcfb2609c6f512f34dd6d54de439.tar.bz2
Kamon-f24c1a7a4b96dcfb2609c6f512f34dd6d54de439.zip
implement MinMaxCounter and Gauge, include them in the InstrumentFactory
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala')
-rw-r--r--kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala11
1 files changed, 6 insertions, 5 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala b/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala
index 1ccd5899..fb6dfe27 100644
--- a/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala
+++ b/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentFactory.scala
@@ -16,7 +16,7 @@ private[metric] class InstrumentFactory private (
customSettings: Map[(String, String), CustomInstrumentSettings]) {
def buildHistogram(entity: Entity, name: String, dynamicRange: DynamicRange = defaultHistogramDynamicRange,
- measurementUnit: MeasurementUnit = MeasurementUnit.none): Histogram = {
+ measurementUnit: MeasurementUnit = MeasurementUnit.none): Histogram with DistributionSnapshotInstrument = {
new HdrHistogram(
entity,
@@ -29,16 +29,17 @@ private[metric] class InstrumentFactory private (
def buildMinMaxCounter(entity: Entity, name: String, dynamicRange: DynamicRange = defaultMMCounterDynamicRange,
sampleInterval: Duration = defaultMMCounterSampleRate, measurementUnit: MeasurementUnit = MeasurementUnit.none): MinMaxCounter = {
- MinMaxCounter(
+ val underlyingHistogram = buildHistogram(entity, name, dynamicRange, measurementUnit)
+ new PaddedMinMaxCounter(
entity,
name,
- instrumentDynamicRange(entity, name, dynamicRange),
+ underlyingHistogram,
instrumentSampleInterval(entity, name, sampleInterval)
)
}
- def buildGauge(entity: Entity, name: String, measurementUnit: MeasurementUnit = MeasurementUnit.none): Gauge =
- Gauge(entity, name)
+ def buildGauge(entity: Entity, name: String, measurementUnit: MeasurementUnit = MeasurementUnit.none): Gauge with SingleValueSnapshotInstrument =
+ new AtomicLongGauge(entity, name, measurementUnit)
def buildCounter(entity: Entity, name: String, measurementUnit: MeasurementUnit = MeasurementUnit.none): Counter with SingleValueSnapshotInstrument =
new LongAdderCounter(entity, name, measurementUnit)