Class SlidingWindowTimeReservoir
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.core.AbstractSlidingWindowTimeReservoir<Long>
org.glassfish.jersey.server.internal.monitoring.SlidingWindowTimeReservoir
- All Implemented Interfaces:
TimeReservoir<Long>
Sliding window time reservoir implementation that stores data of type
Long
.-
Constructor Summary
ConstructorsConstructorDescriptionSlidingWindowTimeReservoir
(long window, TimeUnit windowUnit, long startTime, TimeUnit startTimeUnit) Creates a new sliding window time reservoir with the start time, specified time window and a default trimmer.SlidingWindowTimeReservoir
(long window, TimeUnit windowUnit, long startTime, TimeUnit startTimeUnit, SlidingWindowTrimmer<Long> trimmer) Creates a new sliding window time reservoir with the start time, specified time window and a custom trimmer. -
Method Summary
Modifier and TypeMethodDescriptionprotected UniformTimeSnapshot
snapshot
(Collection<Long> values, long timeInterval, TimeUnit timeIntervalUnit, long time, TimeUnit timeUnit) Subclasses are required to instantiateUniformTimeSnapshot
on their own.Methods inherited from class org.glassfish.jersey.server.internal.monitoring.core.AbstractSlidingWindowTimeReservoir
getSnapshot, interval, size, update
-
Constructor Details
-
SlidingWindowTimeReservoir
public SlidingWindowTimeReservoir(long window, TimeUnit windowUnit, long startTime, TimeUnit startTimeUnit, SlidingWindowTrimmer<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, TimeUnit windowUnit, long startTime, 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 Details
-
snapshot
protected UniformTimeSnapshot snapshot(Collection<Long> values, long timeInterval, TimeUnit timeIntervalUnit, long time, TimeUnit timeUnit) Description copied from class:AbstractSlidingWindowTimeReservoir
Subclasses are required to instantiateUniformTimeSnapshot
on their own.- Specified by:
snapshot
in classAbstractSlidingWindowTimeReservoir<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
-