Package com.codahale.metrics
Class SlidingTimeWindowArrayReservoir
- java.lang.Object
-
- com.codahale.metrics.SlidingTimeWindowArrayReservoir
-
-
Constructor Summary
Constructors Constructor Description SlidingTimeWindowArrayReservoir(long window, TimeUnit windowUnit)Creates a newSlidingTimeWindowArrayReservoirwith the given window of time.SlidingTimeWindowArrayReservoir(long window, TimeUnit windowUnit, Clock clock)Creates a newSlidingTimeWindowArrayReservoirwith the given clock and window of time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SnapshotgetSnapshot()Returns a snapshot of the reservoir's values.intsize()Returns the number of values recorded.voidupdate(long value)Adds a new recorded value to the reservoir.
-
-
-
Constructor Detail
-
SlidingTimeWindowArrayReservoir
public SlidingTimeWindowArrayReservoir(long window, TimeUnit windowUnit)Creates a newSlidingTimeWindowArrayReservoirwith the given window of time.- Parameters:
window- the window of timewindowUnit- the unit ofwindow
-
SlidingTimeWindowArrayReservoir
public SlidingTimeWindowArrayReservoir(long window, TimeUnit windowUnit, Clock clock)Creates a newSlidingTimeWindowArrayReservoirwith the given clock and window of time.- Parameters:
window- the window of timewindowUnit- the unit ofwindowclock- theClockto use
-
-
Method Detail
-
size
public int size()
Description copied from interface:ReservoirReturns the number of values recorded.
-
update
public void update(long value)
Description copied from interface:ReservoirAdds a new recorded value to the reservoir.
-
getSnapshot
public Snapshot getSnapshot()
Description copied from interface:ReservoirReturns a snapshot of the reservoir's values.- Specified by:
getSnapshotin interfaceReservoir- Returns:
- a snapshot of the reservoir's values
-
-