Package io.dropwizard.metrics5
Class SlidingWindowReservoir
java.lang.Object
io.dropwizard.metrics5.SlidingWindowReservoir
- All Implemented Interfaces:
Reservoir
A
Reservoir
implementation backed by a sliding window that stores the last N
measurements.-
Constructor Summary
ConstructorsConstructorDescriptionSlidingWindowReservoir
(int size) Creates a newSlidingWindowReservoir
which stores the lastsize
measurements. -
Method Summary
-
Constructor Details
-
SlidingWindowReservoir
public SlidingWindowReservoir(int size) Creates a newSlidingWindowReservoir
which stores the lastsize
measurements.- Parameters:
size
- the number of measurements to store
-
-
Method Details
-
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
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
-