public class SampledCounterImpl extends CounterImpl implements SampledCounter
SampledCounter
Modifier and Type | Field and Description |
---|---|
protected CircularLossyQueue<TimeStampedCounterValue> |
history
The history of this counter
|
protected boolean |
resetOnSample
Should the counter reset on each sample?
|
Constructor and Description |
---|
SampledCounterImpl(SampledCounterConfig config)
Constructor accepting a
SampledCounterConfig |
Modifier and Type | Method and Description |
---|---|
TimeStampedCounterValue[] |
getAllSampleValues()
Returns all samples in history
|
long |
getAndReset()
Returns the current value of the counter and resets it to 0
|
long |
getIntervalMillis()
Returns the sampling thread interval in millis
|
TimeStampedCounterValue |
getMostRecentSample()
Returns the most recent sampled value
|
TimerTask |
getTimerTask()
Returns the timer task for this sampled counter
|
void |
shutdown()
Shutdown this counter
|
decrement, decrement, getAndSet, getValue, increment, increment, setValue
protected final CircularLossyQueue<TimeStampedCounterValue> history
protected final boolean resetOnSample
public SampledCounterImpl(SampledCounterConfig config)
SampledCounterConfig
config
- public TimeStampedCounterValue getMostRecentSample()
getMostRecentSample
in interface SampledCounter
public TimeStampedCounterValue[] getAllSampleValues()
getAllSampleValues
in interface SampledCounter
public void shutdown()
shutdown
in interface SampledCounter
public TimerTask getTimerTask()
public long getIntervalMillis()
public long getAndReset()
getAndReset
in interface SampledCounter
Copyright 2001-2019, Terracotta, Inc.