| 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()
Reservoirpublic void update(long value)
Reservoirpublic Snapshot getSnapshot()
ReservoirSnapshot of this reservoirgetSnapshot in interface Reservoir