T
- type of the input valuesV
- type of the output valuespublic class IntervalAggregatingStatistic<T,V> extends java.lang.Object implements UnweightedSampleCollector<T>
IntervalAggregatingStatistic
aggregates values over a configured
interval. Each time the interval is over, the aggregated value is written to
the backing statistic and the aggregator is reset. *
Implements the interface UnweightedSampleCollector
, so that it can be used
as a replacement for a normal statistic in any meter.
The type of input and output can be different, as aggregation may convert the type. Example: the average of long values can be returned as double.
Constructor and Description |
---|
IntervalAggregatingStatistic(UnweightedSampleCollector<V> baseStat,
Duration aggregationInterval,
Aggregator<? super T,? extends V> aggregator) |
public IntervalAggregatingStatistic(UnweightedSampleCollector<V> baseStat, Duration aggregationInterval, Aggregator<? super T,? extends V> aggregator)
public void update(T value)
update
in interface UnweightedSampleCollector<T>