Class TimeWindowMax

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

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

    Constructors
    Constructor Description
    TimeWindowMax​(Clock clock, long rotateFrequencyMillis, int bufferLength)  
    TimeWindowMax​(Clock clock, DistributionStatisticConfig config)  
  • Method Summary

    Modifier and Type Method Description
    double poll()  
    double poll​(java.util.concurrent.TimeUnit timeUnit)  
    void record​(double sample)
    For use by distribution summary implementations.
    void record​(double sample, java.util.concurrent.TimeUnit timeUnit)
    For use by timer implementations.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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, java.util.concurrent.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​(java.util.concurrent.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.