Class SlidingTimeWindowReservoir
java.lang.Object
com.codahale.metrics.SlidingTimeWindowReservoir
- All Implemented Interfaces:
Reservoir
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Clockprivate static final intprivate final AtomicLongprivate final AtomicLongprivate final ConcurrentSkipListMap<Long, Long> private static final intprivate final long -
Constructor Summary
ConstructorsConstructorDescriptionSlidingTimeWindowReservoir(long window, TimeUnit windowUnit) Creates a newSlidingTimeWindowReservoirwith the given window of time.SlidingTimeWindowReservoir(long window, TimeUnit windowUnit, Clock clock) Creates a newSlidingTimeWindowReservoirwith the given clock and window of time. -
Method Summary
-
Field Details
-
COLLISION_BUFFER
private static final int COLLISION_BUFFER- See Also:
-
TRIM_THRESHOLD
private static final int TRIM_THRESHOLD- See Also:
-
clock
-
measurements
-
window
private final long window -
lastTick
-
count
-
-
Constructor Details
-
SlidingTimeWindowReservoir
Creates a newSlidingTimeWindowReservoirwith the given window of time.- Parameters:
window- the window of timewindowUnit- the unit ofwindow
-
SlidingTimeWindowReservoir
Creates a newSlidingTimeWindowReservoirwith the given clock and window of time.- Parameters:
window- the window of timewindowUnit- the unit ofwindowclock- theClockto use
-
-
Method Details
-
size
-
update
-
getSnapshot
Description copied from interface:ReservoirReturns a snapshot of the reservoir's values.- Specified by:
getSnapshotin interfaceReservoir- Returns:
- a snapshot of the reservoir's values
-
getTick
private long getTick() -
trim
private void trim()
-