public class SizeHistory
extends java.lang.Object
TimeWindowedList
, tracks the recent history of values to allow a summary of
those values to be obtained.Modifier and Type | Class and Description |
---|---|
static class |
SizeHistory.WindowSummary |
Constructor and Description |
---|
SizeHistory(long windowSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(int val) |
void |
setWindowSize(Duration newWindowSize) |
SizeHistory.WindowSummary |
summarizeWindow(Duration windowSize)
Summarises the history of values in this time window, with a few special things:
If entire time-window is not covered by the given values, then min is Integer.MIN_VALUE and max is Integer.MAX_VALUE
If no values, then latest is -1
If no recent values, then keeps last-seen value (no matter how old), to use that
"stable for growth" means that since that max value, there have not been any higher values
"stable for shrinking" means that since that low value, there have not been any lower values
|
public void add(int val)
public void setWindowSize(Duration newWindowSize)
public SizeHistory.WindowSummary summarizeWindow(Duration windowSize)