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

pack-priv abstract Class AbstractSampledStatistic<T extends java.lang.Number>

extends Object
implements SampledStatistic<T extends Number>
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.extended.SampledStatistic
Known Direct Subclasses
org.terracotta.statistics.extended.SampledStatisticImpl, org.terracotta.statistics.extended.SemiExpiringSampledStatistic
Type Parameters
<T>
the generic type
Imports
org.terracotta.statistics.ValueStatistic, org.terracotta.statistics.archive.Timestamped, java.util.List, java.util.concurrent.ScheduledExecutorService, .TimeUnit

The Class AbstractStatistic.
Author
cdennis

Field Summary

Modifier and TypeField and Description
private final StatisticHistory<T>
history

The history.

private final ValueStatistic<T>
source

The source.

private final StatisticType

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractSampledStatistic(ValueStatistic<T> source, ScheduledExecutorService
the executor
executor
,
int
the history size
historySize
,
long
the history period
historyPeriod
,
TimeUnit
the history time unit
historyTimeUnit
,
StatisticType
type of statistic sampled
type
)

Instantiates a new abstract statistic.

Method Summary

Modifier and TypeMethod and Description
public List<Timestamped<T>>
public List<Timestamped<T>>
history(long
starting point of history in ms
since
)

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

History, from a given time in ms
pack-priv final void
setHistory(int
the history size
historySize
,
long
the history period
historyPeriod
,
TimeUnit
the history time unit
historyTimeUnit
)

Sets the history.

pack-priv final void
startSampling()

Start sampling.

pack-priv final void
stopSampling()

Stop sampling.

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

Field Detail

historyback to summary
private final StatisticHistory<T> history

The history.

sourceback to summary
private final ValueStatistic<T> source

The source.

typeback to summary
private final StatisticType type

Constructor Detail

AbstractSampledStatisticback to summary
pack-priv AbstractSampledStatistic(ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyPeriod, TimeUnit historyTimeUnit, StatisticType type)

Instantiates a new abstract statistic.

Parameters
executor:ScheduledExecutorService

the executor

historySize:int

the history size

historyPeriod:long

the history period

historyTimeUnit:TimeUnit

the history time unit

type:StatisticType

type of statistic sampled

Method Detail

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

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

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

History.

Returns:List<Timestamped<T>>

the list

Annotations
@Override
historyback to summary
public List<Timestamped<T>> 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<T>>

the list

Annotations
@Override
setHistoryback to summary
pack-priv final void setHistory(int historySize, long historyPeriod, TimeUnit historyTimeUnit)

Sets the history.

Parameters
historySize:int

the history size

historyPeriod:long

the history period

historyTimeUnit:TimeUnit

the history time unit

startSamplingback to summary
pack-priv final void startSampling()

Start sampling.

stopSamplingback to summary
pack-priv final void stopSampling()

Stop sampling.

typeback to summary
public StatisticType type()

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

Annotations
@Override
valueback to summary
public T value()

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

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

Value.

Returns:T

the t

Annotations
@Override