Top Description Fields Constructors Methods
org.terracotta.statistics.extended

public Class RateImpl<T extends java.lang.Enum<T>>

extends Object
implements SampledStatistic<Double>
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.extended.SampledStatistic
Type Parameters
<T>
the generic type
Imports
org.terracotta.statistics.OperationStatistic, org.terracotta.statistics.archive.Timestamped, org.terracotta.statistics.derived.EventRateSimpleMovingAverage, .OperationResultFilter, org.terracotta.statistics.observer.ChainedOperationObserver, java.util.List, .Set, java.util.concurrent.ScheduledExecutorService, .TimeUnit

The Class RateStatistic.
Author
cdennis

Field Summary

Modifier and TypeField and Description
private final ExpiringSampledStatistic<Double>
private final EventRateSimpleMovingAverage
rate

The rate.

Constructor Summary

AccessConstructor and Description
public
RateImpl(final OperationStatistic<T>
the source event to monitor
source
,
final Set<T>
the targets
targets
,
long
the average period
averagePeriod
,
TimeUnit
average period unit
averageTimeUnit
,
ScheduledExecutorService
the executor
executor
,
int
the history size
historySize
,
long
the history period
historyPeriod
,
TimeUnit
history period unit
historyTimeUnit
)

Instantiates a new rate statistic.

Method Summary

Modifier and TypeMethod and Description
public boolean
protected boolean

Returns:

true if expired
expire
(long
expiry threshold
expiry
)

Check the statistic for expiry.

public List<Timestamped<Double>>
public List<Timestamped<Double>>
history(long
starting point of history in ms
since
)

Implements org.terracotta.statistics.extended.SampledStatistic.history.

History, from a given time in ms
protected void
setHistory(int
history sample size
historySize
,
long
history sample period
historyPeriod
,
TimeUnit
history time unit
historyTimeUnit
)

Set the sample history parameters.

protected void
setWindow(long
the new window
averagePeriod
,
TimeUnit
the new window's time unit
averageTimeUnit
)

Sets the window.

protected void
start()

Start sampling.

public StatisticType
public Double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final ExpiringSampledStatistic<Double> delegate
rateback to summary
private final EventRateSimpleMovingAverage rate

The rate.

Constructor Detail

RateImplback to summary
public RateImpl(final OperationStatistic<T> source, final Set<T> targets, long averagePeriod, TimeUnit averageTimeUnit, ScheduledExecutorService executor, int historySize, long historyPeriod, TimeUnit historyTimeUnit)

Instantiates a new rate statistic.

Parameters
source:OperationStatistic<T>

the source event to monitor

targets:Set<T>

the targets

averagePeriod:long

the average period

averageTimeUnit:TimeUnit

average period unit

executor:ScheduledExecutorService

the executor

historySize:int

the history size

historyPeriod:long

the history period

historyTimeUnit:TimeUnit

history period unit

Method Detail

activeback to summary
public boolean active()

Implements org.terracotta.statistics.extended.SampledStatistic.active.

Doc from org.terracotta.statistics.extended.SampledStatistic.active.

Active.

Returns:boolean

true, if successful

Annotations
@Override
expireback to summary
protected boolean expire(long expiry)

Check the statistic for expiry.

Parameters
expiry:long

expiry threshold

Returns:boolean

true if expired

historyback to summary
public List<Timestamped<Double>> history()

Implements org.terracotta.statistics.extended.SampledStatistic.history.

Doc from org.terracotta.statistics.extended.SampledStatistic.history.

History.

Returns:List<Timestamped<Double>>

the list

Annotations
@Override
historyback to summary
public List<Timestamped<Double>> history(long since)

Implements org.terracotta.statistics.extended.SampledStatistic.history.

Doc from org.terracotta.statistics.extended.SampledStatistic.history.

History, from a given time in ms

Parameters
since:long

starting point of history in ms

Returns:List<Timestamped<Double>>

the list

Annotations
@Override
setHistoryback to summary
protected void setHistory(int historySize, long historyPeriod, TimeUnit historyTimeUnit)

Set the sample history parameters.

Parameters
historySize:int

history sample size

historyPeriod:long

history sample period

historyTimeUnit:TimeUnit

history time unit

setWindowback to summary
protected void setWindow(long averagePeriod, TimeUnit averageTimeUnit)

Sets the window.

Parameters
averagePeriod:long

the new window

averageTimeUnit:TimeUnit

the new window's time unit

startback to summary
protected void start()

Start sampling.

typeback to summary
public StatisticType type()

Implements org.terracotta.statistics.extended.SampledStatistic.type.

Annotations
@Override
valueback to summary
public Double value()

Implements org.terracotta.statistics.extended.SampledStatistic.value.

Doc from org.terracotta.statistics.extended.SampledStatistic.value.

Value.

Returns:Double

the t

Annotations
@Override