Class TimeWindowMax

java.lang.Object
io.micrometer.core.instrument.distribution.TimeWindowMax

public class TimeWindowMax extends Object
An implementation of a decaying maximum for a distribution based on a configurable ring buffer.
  • Constructor Details

    • TimeWindowMax

      public TimeWindowMax(Clock clock, DistributionStatisticConfig config)
    • TimeWindowMax

      public TimeWindowMax(Clock clock, long rotateFrequencyMillis, int bufferLength)
  • Method Details

    • record

      public void record(double sample, TimeUnit timeUnit)
      For use by timer implementations.
      Parameters:
      sample - The value to record.
      timeUnit - The unit of time of the incoming sample.
    • poll

      public double poll(TimeUnit timeUnit)
      Parameters:
      timeUnit - The base unit of time to scale the max to.
      Returns:
      A max scaled to the base unit of time. For use by timer implementations.
    • poll

      public double poll()
      Returns:
      An unscaled max. For use by distribution summary implementations.
    • record

      public void record(double sample)
      For use by distribution summary implementations.
      Parameters:
      sample - The value to record.