Top Description Fields Constructors Methods
net.sf.ehcache.statistics.extended

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

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

The Class RateStatistic.
Author
cdennis

Field Summary

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

The rate.

Constructor Summary

AccessConstructor and Description
public
RateImpl(final SourceStatistic<ChainedOperationObserver<T>> source, final Set<T>
the targets
targets
,
long
the average nanos
averageNanos
,
ScheduledExecutorService
the executor
executor
,
int
the history size
historySize
,
long
the history nanos
historyNanos
)

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>>
protected void
setHistory(int
history sample size
historySize
,
long
history sample period
historyNanos
)

Set the sample history parameters.

protected void
setWindow(long
the new window
averageNanos
)

Sets the window.

protected void
start()

Start sampling.

public Double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

The rate.

Constructor Detail

RateImplback to summary
public RateImpl(final SourceStatistic<ChainedOperationObserver<T>> source, final Set<T> targets, long averageNanos, ScheduledExecutorService executor, int historySize, long historyNanos)

Instantiates a new rate statistic.

Parameters
targets:Set<T>

the targets

averageNanos:long

the average nanos

executor:ScheduledExecutorService

the executor

historySize:int

the history size

historyNanos:long

the history nanos

Method Detail

activeback to summary
public boolean active()

Implements net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.active.

Doc from net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.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 net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.history.

Doc from net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.history.

History.

Returns:List<Timestamped<Double>>

the list

Annotations
@Override
setHistoryback to summary
protected void setHistory(int historySize, long historyNanos)

Set the sample history parameters.

Parameters
historySize:int

history sample size

historyNanos:long

history sample period

setWindowback to summary
protected void setWindow(long averageNanos)

Sets the window.

Parameters
averageNanos:long

the new window

startback to summary
protected void start()

Start sampling.

valueback to summary
public Double value()

Implements net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.value.

Doc from net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic.value.

Value.

Returns:Double

the t

Annotations
@Override