class SlidingWindowTimeReservoir extends AbstractSlidingWindowTimeReservoir<java.lang.Long>
Long
.Constructor and Description |
---|
SlidingWindowTimeReservoir(long window,
java.util.concurrent.TimeUnit windowUnit,
long startTime,
java.util.concurrent.TimeUnit startTimeUnit)
Creates a new sliding window time reservoir with the start time, specified time window and a default trimmer.
|
SlidingWindowTimeReservoir(long window,
java.util.concurrent.TimeUnit windowUnit,
long startTime,
java.util.concurrent.TimeUnit startTimeUnit,
SlidingWindowTrimmer<java.lang.Long> trimmer)
Creates a new sliding window time reservoir with the start time, specified time window and a custom trimmer.
|
Modifier and Type | Method and Description |
---|---|
protected UniformTimeSnapshot |
snapshot(java.util.Collection<java.lang.Long> values,
long timeInterval,
java.util.concurrent.TimeUnit timeIntervalUnit,
long time,
java.util.concurrent.TimeUnit timeUnit)
Subclasses are required to instantiate
UniformTimeSnapshot on their own. |
getSnapshot, interval, size, update
public SlidingWindowTimeReservoir(long window, java.util.concurrent.TimeUnit windowUnit, long startTime, java.util.concurrent.TimeUnit startTimeUnit, SlidingWindowTrimmer<java.lang.Long> trimmer)
window
- The window of startTime.windowUnit
- The unit of window
.startTime
- The start time from which this reservoir calculates measurements.startTimeUnit
- The start time unit.trimmer
- The trimmer to use for trimming, if null
, default trimmer is used.public SlidingWindowTimeReservoir(long window, java.util.concurrent.TimeUnit windowUnit, long startTime, java.util.concurrent.TimeUnit startTimeUnit)
window
- The window of startTime.windowUnit
- The unit of window
.startTime
- The start time from which this reservoir calculates measurements.startTimeUnit
- The start time unit.protected UniformTimeSnapshot snapshot(java.util.Collection<java.lang.Long> values, long timeInterval, java.util.concurrent.TimeUnit timeIntervalUnit, long time, java.util.concurrent.TimeUnit timeUnit)
AbstractSlidingWindowTimeReservoir
UniformTimeSnapshot
on their own.snapshot
in class AbstractSlidingWindowTimeReservoir<java.lang.Long>
values
- The values to create the snapshot fromtimeInterval
- The time interval this snapshot conforms totimeIntervalUnit
- The interval unit of the time intervaltime
- The time of the request of the snapshottimeUnit
- The unit of the time of the snapshot request