Class StepValue<V>

java.lang.Object
io.micrometer.core.instrument.step.StepValue<V>
Direct Known Subclasses:
StepBucketHistogram, StepDouble, StepLong

public abstract class StepValue<V> extends Object
Tracks 'values' for periods (steps) of time. The previous step's value is obtained by calling poll().
Since:
1.4.0
  • Constructor Details

    • StepValue

      public StepValue(Clock clock, long stepMillis)
    • StepValue

      protected StepValue(Clock clock, long stepMillis, @Nullable V initValue)
  • Method Details

    • valueSupplier

      protected abstract Supplier<V> valueSupplier()
    • noValue

      protected abstract V noValue()
      Returns:
      value that should be returned by poll() if within the first step period or if the previous step didn't record a value.
    • poll

      public V poll()
      Returns:
      The value for the last completed interval.
    • _closingRollover

      protected void _closingRollover()
      This is an internal method not meant for general use.

      Rolls the values regardless of the clock or current time and ensures the value will never roll over again after.