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 Details

    • getLatestExponentialHistogramSnapshot

      public abstract ExponentialHistogramSnapShot getLatestExponentialHistogramSnapshot()
      Returns the latest snapshot of recordings from takeExponentialHistogramSnapShot() 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 Micrometer HistogramSnapshot.
      Specified by:
      takeSnapshot in interface io.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 to baseUnit.
      Specified by:
      recordLong in interface io.micrometer.core.instrument.distribution.Histogram
      Parameters:
      value - - value to be recorded in the Histogram. (in TimeUnit.NANOSECONDS if recording time.)
    • recordDouble

      public void recordDouble(double value)
      Records the value to the Histogram. While measuring time, this value will be converted baseUnit.
      Specified by:
      recordDouble in interface io.micrometer.core.instrument.distribution.Histogram
      Parameters:
      value - - value to be recorded in the Histogram. (in TimeUnit.NANOSECONDS if recording time.)