SlidingTimeWindowReservoir class

A Reservoir implementation backed by a sliding window that stores only the measurements made in the last N seconds (or other time unit).

Implemented types

Constructors

SlidingTimeWindowReservoir(Duration window, [Clock clock = const Clock()])
Creates a new SlidingTimeWindowReservoir with the given clock and duration.

Properties

clock → Clock
final
hashCode int
The hash code for this object.
no setterinherited
measurements Map<DateTime, List<int>>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
The number of values recorded.
no setteroverride
snapshot Snapshot
A snapshot of the reservoir's values.
no setteroverride
window Duration
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(int value) → void
Adds a new recorded value to the reservoir.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

trimThreshold → const int