Top Inners Fields Constructors Methods
org.terracotta.statistics.derived

public Class EventParameterSimpleMovingAverage

extends Object
implements ChainedEventObserver
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.observer.ChainedEventObserver, org.terracotta.statistics.observer.ChainedObserver
Static Imports
org.terracotta.statistics.Time.time

Author
cdennis

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final AtomicReference<EventParameterSimpleMovingAverage.AveragePartition>
private final Queue<EventParameterSimpleMovingAverage.AveragePartition>
private static final int
private volatile long
private volatile long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public final double
public ValueStatistic<Double>
public void
event(long
the time of the event
time
,
long...
the event parameters
parameters
)

Implements org.terracotta.statistics.observer.ChainedEventObserver.event.

Called to indicate an event happened.
public final Long
public ValueStatistic<Long>
public final Long
public ValueStatistic<Long>
public void
setWindow(long time, TimeUnit unit)

public Double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activePartitionback to summary
private final AtomicReference<EventParameterSimpleMovingAverage.AveragePartition> activePartition
archiveback to summary
private final Queue<EventParameterSimpleMovingAverage.AveragePartition> archive
PARTITION_COUNTback to summary
private static final int PARTITION_COUNT
partitionSizeback to summary
private volatile long partitionSize
windowSizeback to summary
private volatile long windowSize

Constructor Detail

EventParameterSimpleMovingAverageback to summary
public EventParameterSimpleMovingAverage(long time, TimeUnit unit)

Method Detail

archiveback to summary
private void archive(EventParameterSimpleMovingAverage.AveragePartition partition)
averageback to summary
public final double average()
averageStatisticback to summary
public ValueStatistic<Double> averageStatistic()
eventback to summary
public void event(long time, long... parameters)

Implements org.terracotta.statistics.observer.ChainedEventObserver.event.

Doc from org.terracotta.statistics.observer.ChainedEventObserver.event.

Called to indicate an event happened.

Parameters
time:long

the time of the event

parameters:long[]

the event parameters

Annotations
@Override
maximumback to summary
public final Long maximum()
maximumStatisticback to summary
public ValueStatistic<Long> maximumStatistic()
minimumback to summary
public final Long minimum()
minimumStatisticback to summary
public ValueStatistic<Long> minimumStatistic()
setWindowback to summary
public void setWindow(long time, TimeUnit unit)
valueback to summary
public Double value()
org.terracotta.statistics.derived back to summary

pack-priv Class EventParameterSimpleMovingAverage.Average

extends Object
Class Inheritance
  • java.lang.Object
  • org.terracotta.statistics.derived.EventParameterSimpleMovingAverage.Average

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
pack-priv long count
totalback to summary
pack-priv long total

Constructor Detail

Averageback to summary
pack-priv Average()
org.terracotta.statistics.derived back to summary

pack-priv Class EventParameterSimpleMovingAverage.AveragePartition

extends Object
Class Inheritance
  • java.lang.Object
  • org.terracotta.statistics.derived.EventParameterSimpleMovingAverage.AveragePartition

Field Summary

Modifier and TypeField and Description
private final LongAdder
private final long
private final LongAccumulator
private final LongAccumulator
private final long
private final LongAdder

Constructor Summary

AccessConstructor and Description
public
AveragePartition(long start, long length)

Method Summary

Modifier and TypeMethod and Description
public void
public long
end()

public void
event(long parameter)

public boolean
isBefore(long time)

public long
public long
public long
public boolean
targetFor(long time)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private final LongAdder count
endback to summary
private final long end
maximumback to summary
private final LongAccumulator maximum
minimumback to summary
private final LongAccumulator minimum
startback to summary
private final long start
totalback to summary
private final LongAdder total

Constructor Detail

AveragePartitionback to summary
public AveragePartition(long start, long length)

Method Detail

aggregateback to summary
public void aggregate(EventParameterSimpleMovingAverage.Average average)
endback to summary
public long end()
eventback to summary
public void event(long parameter)
isBeforeback to summary
public boolean isBefore(long time)
maximumback to summary
public long maximum()
minimumback to summary
public long minimum()
startback to summary
public long start()
targetForback to summary
public boolean targetFor(long time)