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
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.
-
-
-
Constructor Detail
-
TimeWindowMax
public TimeWindowMax(Clock clock, DistributionStatisticConfig config)
-
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.
-
-