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

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

extends Object
Class Inheritance
Type Parameters
<T>
the generic type
Imports
org.terracotta.statistics.ValueStatistic, org.terracotta.statistics.archive.StatisticArchive, .StatisticSampler, .Timestamped, java.util.List, java.util.concurrent.ScheduledExecutorService, .TimeUnit

The Class StatisticHistory.
Author
cdennis

Field Summary

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

The history.

private final StatisticSampler<T>
sampler

The sampler.

Constructor Summary

AccessConstructor and Description
public
StatisticHistory(ValueStatistic<T>
the statistic
statistic
,
ScheduledExecutorService
the executor
executor
,
int
the history size
historySize
,
long
the period
period
,
TimeUnit
the period's time unit
periodTimeUnit
)

Instantiates a new sampled statistic.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
adjust(int
the history size
historySize
,
long
the history period
historyPeriod
,
TimeUnit
the history period's time unit
historyTimeUnit
)

Adjust.

public List<Timestamped<T>>

Returns:

the list
history
()

History.

public List<Timestamped<T>>

Returns:

the list
history
(long since)

History since given time in ms

public void
startSampling()

Start sampling.

public void
stopSampling()

Stop sampling.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

historyback to summary
private final StatisticArchive<T> history

The history.

samplerback to summary
private final StatisticSampler<T> sampler

The sampler.

Constructor Detail

StatisticHistoryback to summary
public StatisticHistory(ValueStatistic<T> statistic, ScheduledExecutorService executor, int historySize, long period, TimeUnit periodTimeUnit)

Instantiates a new sampled statistic.

Parameters
statistic:ValueStatistic<T>

the statistic

executor:ScheduledExecutorService

the executor

historySize:int

the history size

period:long

the period

periodTimeUnit:TimeUnit

the period's time unit

Method Detail

adjustback to summary
pack-priv void adjust(int historySize, long historyPeriod, TimeUnit historyTimeUnit)

Adjust.

Parameters
historySize:int

the history size

historyPeriod:long

the history period

historyTimeUnit:TimeUnit

the history period's time unit

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

History.

Returns:List<Timestamped<T>>

the list

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

History since given time in ms

Returns:List<Timestamped<T>>

the list

startSamplingback to summary
public void startSampling()

Start sampling.

stopSamplingback to summary
public void stopSampling()

Stop sampling.