Class TimeWindowMax


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

      All Methods Instance Methods Concrete Methods 
      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 Detail

      • TimeWindowMax

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

      • 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.