Constructor and Description |
---|
SlidingTimeWindowReservoir()
Default constructor using default window size
|
SlidingTimeWindowReservoir(long windowMs)
Construct the SlidingTimeWindowReservoir with window size
|
SlidingTimeWindowReservoir(long windowMs,
Clock clock) |
SlidingTimeWindowReservoir(long windowMs,
int collisionBuffer,
Clock clock) |
Modifier and Type | Method and Description |
---|---|
Snapshot |
getSnapshot()
Return a
Snapshot of this reservoir |
int |
size()
Return the number of values in this reservoir
|
void |
update(long value)
Update the reservoir with the new value
|
public SlidingTimeWindowReservoir()
public SlidingTimeWindowReservoir(long windowMs)
windowMs
- the size of the window. unit is millisecond.public SlidingTimeWindowReservoir(long windowMs, Clock clock)
public SlidingTimeWindowReservoir(long windowMs, int collisionBuffer, Clock clock)
public int size()
Reservoir
public void update(long value)
Reservoir
public Snapshot getSnapshot()
Reservoir
Snapshot
of this reservoirgetSnapshot
in interface Reservoir