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 newSlidingWindowReservoirwhich stores the lastsizemeasurements. -
Method Summary
-
Constructor Details
-
SlidingWindowReservoir
public SlidingWindowReservoir(int size) Creates a newSlidingWindowReservoirwhich stores the lastsizemeasurements.- Parameters:
size- the number of measurements to store
-
-
Method Details
-
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
Description copied from interface:ReservoirReturns a snapshot of the reservoir's values.- Specified by:
getSnapshotin interfaceReservoir- Returns:
- a snapshot of the reservoir's values
-