Class Base2ExponentialHistogram
java.lang.Object
io.micrometer.registry.otlp.internal.Base2ExponentialHistogram
- All Implemented Interfaces:
io.micrometer.core.instrument.distribution.Histogram,AutoCloseable
- Direct Known Subclasses:
CumulativeBase2ExponentialHistogram,DeltaBase2ExponentialHistogram
public abstract class Base2ExponentialHistogram
extends Object
implements io.micrometer.core.instrument.distribution.Histogram
A ExponentialHistogram implementation that compresses bucket boundaries using an
exponential formula (Base2 exponent), making it suitable for conveying high dynamic
range data with small relative error. This is an implementation of the Exponential
Histogram as per the OTLP specification. The internal implementations uses the
techniques outlined in the OTLP specification mentioned above. This implementation
supports only recording positive values (enforced by
AbstractTimer.record(long, TimeUnit)).
This is an internal class and might have breaking changes, external implementations SHOULD NOT rely on this implementation.
- Since:
- 1.14.0
-
Method Summary
Modifier and TypeMethodDescriptionabstract ExponentialHistogramSnapShotReturns the latest snapshot of recordings fromtakeExponentialHistogramSnapShot()and not the current set of values.voidrecordDouble(double value) Records the value to the Histogram.voidrecordLong(long value) Records the value to the Histogram.io.micrometer.core.instrument.distribution.HistogramSnapshottakeSnapshot(long count, double total, double max) Provides a bridge to MicrometerHistogramSnapshot.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micrometer.core.instrument.distribution.Histogram
close
-
Method Details
-
getLatestExponentialHistogramSnapshot
Returns the latest snapshot of recordings fromtakeExponentialHistogramSnapShot()and not the current set of values. It is recommended to use this method to consume values recorded in this Histogram as this will provide consistency in recorded values. -
takeSnapshot
public io.micrometer.core.instrument.distribution.HistogramSnapshot takeSnapshot(long count, double total, double max) Provides a bridge to MicrometerHistogramSnapshot.- Specified by:
takeSnapshotin interfaceio.micrometer.core.instrument.distribution.Histogram
-
recordLong
public void recordLong(long value) Records the value to the Histogram. While measuring time, this value will be converted tobaseUnit.- Specified by:
recordLongin interfaceio.micrometer.core.instrument.distribution.Histogram- Parameters:
value- - value to be recorded in the Histogram. (inTimeUnit.NANOSECONDSif recording time.)
-
recordDouble
public void recordDouble(double value) Records the value to the Histogram. While measuring time, this value will be convertedbaseUnit.- Specified by:
recordDoublein interfaceio.micrometer.core.instrument.distribution.Histogram- Parameters:
value- - value to be recorded in the Histogram. (inTimeUnit.NANOSECONDSif recording time.)
-