Class LatencySimpleMovingAverage
java.lang.Object
org.terracotta.statistics.derived.latency.LatencySimpleMovingAverage
- All Implemented Interfaces:
LatencyStatistic,ChainedEventObserver,ChainedObserver
public class LatencySimpleMovingAverage
extends Object
implements ChainedEventObserver, LatencyStatistic
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<LatencyPeriodAccumulator>private final Queue<LatencyPeriodAccumulator>private static final intprivate final longprivate final long -
Constructor Summary
ConstructorsConstructorDescriptionLatencySimpleMovingAverage(long time, TimeUnit unit) LatencySimpleMovingAverage(long time, TimeUnit unit, int partitionCount) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.terracotta.statistics.derived.latency.LatencyStatistic
averageStatistic, maximumStatistic, minimumStatistic
-
Field Details
-
PARTITION_COUNT
private static final int PARTITION_COUNT- See Also:
-
archive
-
activePartition
-
windowSize
private final long windowSize -
partitionSize
private final long partitionSize
-
-
Constructor Details
-
LatencySimpleMovingAverage
-
LatencySimpleMovingAverage
-
-
Method Details
-
average
public final double average()- Specified by:
averagein interfaceLatencyStatistic- Returns:
- The average in ns or NaN if no value
-
maximum
- Specified by:
maximumin interfaceLatencyStatistic- Returns:
- The maximum in ns or null if it does not exist yet
-
minimum
- Specified by:
minimumin interfaceLatencyStatistic- Returns:
- The minimum in ns or null if it does not exist yet
-
event
public void event(long timeNs, long latencyNs) Description copied from interface:ChainedEventObserverCalled to indicate an event happened.- Specified by:
eventin interfaceChainedEventObserver- Parameters:
timeNs- the clock at event completion in nslatencyNs- the event latency in ns
-
archive
-