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

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

extends AbstractSampledStatistic<T extends Number>
implements SamplingSupport
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.extended.SamplingSupport
Known Direct Subclasses
org.terracotta.statistics.extended.ExpiringSampledStatistic
Type Parameters
<T>
statistic type
Imports
org.terracotta.statistics.Time, .ValueStatistic, org.terracotta.statistics.archive.Timestamped, java.util.List, java.util.concurrent.ScheduledExecutorService, .TimeUnit

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 volatile boolean
private long
touchTimestamp

The touch timestamp.

Constructor Summary

AccessConstructor and Description
public
SemiExpiringSampledStatistic(ValueStatistic<T>
statistic source
source
,
ScheduledExecutorService
executor to use for sampling
executor
,
int
size of sample history
historySize
,
long
period between samples
historyTime
,
TimeUnit
unit of period between samples
historyTimeUnit
,
StatisticType
sampling type
type
)

Creates a new semi-expiring statistic.

Method Summary

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

Returns:

true, if successful
expire
(long
the expiry
expiry
)

Implements org.terracotta.statistics.extended.SamplingSupport.expire.

Expire.
public List<Timestamped<T>>
public List<Timestamped<T>>
history(long
starting point of history in ms
since
)

Overrides org.terracotta.statistics.extended.AbstractSampledStatistic.history.

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

History, from a given time in ms
public void
protected final synchronized void
start()

Start.

protected void
startStatistic()

Start statistic.

protected void
stopStatistic()

Stop statistic.

protected final synchronized void
touch()

Touch.

Inherited from org.terracotta.statistics.extended.AbstractSampledStatistic:
setHistorystartSamplingstopSamplingtypevalue

Field Detail

activeback to summary
private boolean active

The active.

alwaysOnback to summary
private volatile boolean alwaysOn
touchTimestampback to summary
private long touchTimestamp

The touch timestamp.

Constructor Detail

SemiExpiringSampledStatisticback to summary
public SemiExpiringSampledStatistic(ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyTime, TimeUnit historyTimeUnit, StatisticType type)

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

historyTime:long

period between samples

historyTimeUnit:TimeUnit

unit of period between samples

type:StatisticType

sampling type

Method Detail

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

Implements org.terracotta.statistics.extended.SamplingSupport.expire.

Expire.

Parameters
expiry:long

the expiry

Returns:boolean

true, if successful

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

Overrides org.terracotta.statistics.extended.AbstractSampledStatistic.history.

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

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

History.

Returns:List<Timestamped<T>>

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

the list

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

Overrides org.terracotta.statistics.extended.AbstractSampledStatistic.history.

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<T>>

the list

Annotations
@Override
setAlwaysOnback to summary
public void setAlwaysOn(boolean enable)

Implements org.terracotta.statistics.extended.SamplingSupport.setAlwaysOn.

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.