Class StepValue<V>

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

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

    Constructors
    Constructor Description
    StepValue​(Clock clock, long stepMillis)  
  • Method Summary

    Modifier and Type Method Description
    protected abstract V noValue()  
    V poll()  
    protected abstract java.util.function.Supplier<V> valueSupplier()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StepValue

      public StepValue​(Clock clock, long stepMillis)
  • Method Details

    • valueSupplier

      protected abstract java.util.function.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.