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

public Class SemiExpiringStatistic<T extends java.lang.Number>

extends AbstractStatistic<T extends Number>
Class Inheritance
Known Direct Subclasses
net.sf.ehcache.statistics.extended.ExpiringStatistic
Type Parameters
<T>
statistic type
Imports
java.util.List, java.util.concurrent.ScheduledExecutorService, org.terracotta.statistics.Time, .ValueStatistic, org.terracotta.statistics.archive.Timestamped

Statistic implementation that stops sampling history if the last history access is before a user supplied timestamp.
Author
Chris Dennis

Field Summary

Modifier and TypeField and Description
private boolean
active

The active.

private long
touchTimestamp

The touch timestamp.

Constructor Summary

AccessConstructor and Description
public
SemiExpiringStatistic(ValueStatistic<T>
statistic source
source
,
ScheduledExecutorService
executor to use for sampling
executor
,
int
size of sample history
historySize
,
long
period between samples
historyNanos
)

Creates a new semi-expiring statistic.

Method Summary

Modifier and TypeMethod and Description
public final synchronized boolean
protected final synchronized boolean

Returns:

true, if successful
expire
(long
the expiry
expiry
)

Expire.

public List<Timestamped<T>>
protected final synchronized void
start()

Start.

protected void
startStatistic()

Start statistic.

protected void
stopStatistic()

Stop statistic.

protected final synchronized void
touch()

Touch.

Inherited from net.sf.ehcache.statistics.extended.AbstractStatistic:
setHistorystartSamplingstopSamplingvalue

Field Detail

activeback to summary
private boolean active

The active.

touchTimestampback to summary
private long touchTimestamp

The touch timestamp.

Constructor Detail

SemiExpiringStatisticback to summary
public SemiExpiringStatistic(ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyNanos)

Creates a new semi-expiring statistic.

Parameters
source:ValueStatistic<T>

statistic source

executor:ScheduledExecutorService

executor to use for sampling

historySize:int

size of sample history

historyNanos:long

period between samples

Method Detail

activeback to summary
public final synchronized 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 final synchronized boolean expire(long expiry)

Expire.

Parameters
expiry:long

the expiry

Returns:boolean

true, if successful

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

Overrides net.sf.ehcache.statistics.extended.AbstractStatistic.history.

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

Doc from net.sf.ehcache.statistics.extended.AbstractStatistic.history.

History.

Returns:List<Timestamped<T>>

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

the list

Annotations
@Override
startback to summary
protected final synchronized void start()

Start.

startStatisticback to summary
protected void startStatistic()

Start statistic.

stopStatisticback to summary
protected void stopStatistic()

Stop statistic.

touchback to summary
protected final synchronized void touch()

Touch.