public class MaximumLatencyHistory extends Object implements ChainedEventObserver, SampledStatistic<Long>
This is important to note that the history is based on a sample count and not a time frame. If you set a history to 100 samples and a window of 500ms, you won't have a complete time-frame of 10 seconds. You can have a sample at t0, then another one at t0 + 1 sec depending on when the operations occur.
| Constructor and Description |
|---|
MaximumLatencyHistory(int historySize,
long windowSize,
TimeUnit windowSizeUnit,
LongSupplier timeSupplier) |
MaximumLatencyHistory(int historySize,
long windowSize,
TimeUnit windowSizeUnit,
LongSupplier timeSupplier,
Consumer<LatencyPeriodAccumulator> sink) |
| Modifier and Type | Method and Description |
|---|---|
void |
event(long timeNs,
long latencyNs)
Called to indicate an event happened.
|
List<Sample<Long>> |
history()
The history of values
|
List<Sample<Long>> |
history(long sinceMillis)
The history of values, since a given time in ms
|
StatisticType |
type() |
Long |
value() |
public MaximumLatencyHistory(int historySize,
long windowSize,
TimeUnit windowSizeUnit,
LongSupplier timeSupplier)
public MaximumLatencyHistory(int historySize,
long windowSize,
TimeUnit windowSizeUnit,
LongSupplier timeSupplier,
Consumer<LatencyPeriodAccumulator> sink)
historySize - The number of samples to keepwindowSize - The size of the window over which the reduction is applied. A small value is better for more details, but history might discard values faster.windowSizeUnit - Window size unitsink - The sink used to collect the old values that are discarded from the history.public void event(long timeNs,
long latencyNs)
ChainedEventObserverevent in interface ChainedEventObservertimeNs - the clock at event completion in nslatencyNs - the event latency in nspublic Long value()
value in interface ValueStatistic<Long>public StatisticType type()
type in interface ValueStatistic<Long>public List<Sample<Long>> history()
SampledStatistichistory in interface SampledStatistic<Long>public List<Sample<Long>> history(long sinceMillis)
SampledStatistichistory in interface SampledStatistic<Long>sinceMillis - starting point of history in msCopyright © 2018. All rights reserved.