Package io.dropwizard.metrics5
Class SlidingWindowReservoir
- java.lang.Object
-
- io.dropwizard.metrics5.SlidingWindowReservoir
-
-
Constructor Summary
Constructors Constructor Description SlidingWindowReservoir(int size)Creates a newSlidingWindowReservoirwhich stores the lastsizemeasurements.
-
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
-
SlidingWindowReservoir
public SlidingWindowReservoir(int size)
Creates a newSlidingWindowReservoirwhich stores the lastsizemeasurements.- Parameters:
size- the number of measurements to store
-
-
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
-
-