T - statistic typepublic class SemiExpiringSampledStatistic<T extends Number> extends Object
| Constructor and Description |
|---|
SemiExpiringSampledStatistic(ValueStatistic<T> source,
ScheduledExecutorService executor,
int historySize,
long historyTime,
TimeUnit historyTimeUnit)
Creates a new semi-expiring statistic.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
active()
Active.
|
protected boolean |
expire(long expiry)
Expire.
|
List<Timestamped<T>> |
history()
History.
|
protected void |
start()
Start.
|
protected void |
startStatistic()
Start statistic.
|
protected void |
stopStatistic()
Stop statistic.
|
protected void |
touch()
Touch.
|
T |
value()
Value.
|
public SemiExpiringSampledStatistic(ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyTime, TimeUnit historyTimeUnit)
source - statistic sourceexecutor - executor to use for samplinghistorySize - size of sample historyhistoryTime - period between sampleshistoryTimeUnit - unit of period between samplespublic List<Timestamped<T>> history()
history in interface SampledStatistic<T extends Number>public final boolean active()
SampledStatisticprotected final void touch()
protected final void start()
protected final boolean expire(long expiry)
expiry - the expiryprotected void stopStatistic()
protected void startStatistic()
public T value()
value in interface SampledStatistic<T extends Number>Copyright © 2016. All rights reserved.