Package com.codahale.metrics
Class SlidingWindowReservoir
- java.lang.Object
-
- com.codahale.metrics.SlidingWindowReservoir
-
-
Constructor Summary
Constructors Constructor Description SlidingWindowReservoir(int size)
Creates a newSlidingWindowReservoir
which stores the lastsize
measurements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Snapshot
getSnapshot()
Returns a snapshot of the reservoir's values.int
size()
Returns the number of values recorded.void
update(long value)
Adds a new recorded value to the reservoir.
-
-
-
Constructor Detail
-
SlidingWindowReservoir
public SlidingWindowReservoir(int size)
Creates a newSlidingWindowReservoir
which stores the lastsize
measurements.- Parameters:
size
- the number of measurements to store
-
-
Method Detail
-
size
public int size()
Description copied from interface:Reservoir
Returns the number of values recorded.
-
update
public void update(long value)
Description copied from interface:Reservoir
Adds a new recorded value to the reservoir.
-
getSnapshot
public Snapshot getSnapshot()
Description copied from interface:Reservoir
Returns a snapshot of the reservoir's values.- Specified by:
getSnapshot
in interfaceReservoir
- Returns:
- a snapshot of the reservoir's values
-
-