Class SlidingWindowTimeReservoir
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.core.AbstractSlidingWindowTimeReservoir<java.lang.Long>
-
- org.glassfish.jersey.server.internal.monitoring.SlidingWindowTimeReservoir
-
- All Implemented Interfaces:
TimeReservoir<java.lang.Long>
class SlidingWindowTimeReservoir extends AbstractSlidingWindowTimeReservoir<java.lang.Long>
Sliding window time reservoir implementation that stores data of typeLong.
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UniformTimeSnapshotsnapshot(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 instantiateUniformTimeSnapshoton their own.-
Methods inherited from class org.glassfish.jersey.server.internal.monitoring.core.AbstractSlidingWindowTimeReservoir
getSnapshot, interval, size, update
-
-
-
-
Constructor Detail
-
SlidingWindowTimeReservoir
public 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.- Parameters:
window- The window of startTime.windowUnit- The unit ofwindow.startTime- The start time from which this reservoir calculates measurements.startTimeUnit- The start time unit.trimmer- The trimmer to use for trimming, ifnull, default trimmer is used.
-
SlidingWindowTimeReservoir
public 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.- Parameters:
window- The window of startTime.windowUnit- The unit ofwindow.startTime- The start time from which this reservoir calculates measurements.startTimeUnit- The start time unit.
-
-
Method Detail
-
snapshot
protected UniformTimeSnapshot snapshot(java.util.Collection<java.lang.Long> values, long timeInterval, java.util.concurrent.TimeUnit timeIntervalUnit, long time, java.util.concurrent.TimeUnit timeUnit)
Description copied from class:AbstractSlidingWindowTimeReservoirSubclasses are required to instantiateUniformTimeSnapshoton their own.- Specified by:
snapshotin classAbstractSlidingWindowTimeReservoir<java.lang.Long>- Parameters:
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- Returns:
- The snapshot
-
-