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, setValueprotected final CircularLossyQueue<TimeStampedCounterValue> history
protected final boolean resetOnSample
public SampledCounterImpl(SampledCounterConfig config)
SampledCounterConfigconfig - public TimeStampedCounterValue getMostRecentSample()
getMostRecentSample in interface SampledCounterpublic TimeStampedCounterValue[] getAllSampleValues()
getAllSampleValues in interface SampledCounterpublic void shutdown()
shutdown in interface SampledCounterpublic TimerTask getTimerTask()
public long getIntervalMillis()
public long getAndReset()
getAndReset in interface SampledCounterCopyright 2001-2019, Terracotta, Inc.