|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.util.counter.CounterImpl net.sf.ehcache.util.counter.sampled.SampledCounterImpl
public class SampledCounterImpl
An implementation of SampledCounter
Field Summary | |
---|---|
protected CircularLossyQueue<TimeStampedCounterValue> |
history
The history of this counter |
protected boolean |
resetOnSample
Should the counter reset on each sample? |
Constructor Summary | |
---|---|
SampledCounterImpl(long intervalInSeconds,
int historySize,
boolean resetOnSample,
long initValue,
boolean sampleNow)
Constructor accepting raw config values. |
|
SampledCounterImpl(SampledCounterConfig config)
todo GL how many threads is this creating? Constructor accepting a SampledCounterConfig |
Method Summary | |
---|---|
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 |
Methods inherited from class net.sf.ehcache.util.counter.CounterImpl |
---|
decrement, decrement, getAndSet, getValue, increment, increment, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.ehcache.util.counter.Counter |
---|
decrement, decrement, getAndSet, getValue, increment, increment, setValue |
Field Detail |
---|
protected final CircularLossyQueue<TimeStampedCounterValue> history
protected final boolean resetOnSample
Constructor Detail |
---|
public SampledCounterImpl(SampledCounterConfig config)
SampledCounterConfig
config
- public SampledCounterImpl(long intervalInSeconds, int historySize, boolean resetOnSample, long initValue, boolean sampleNow)
intervalInSeconds
- sampling interval in secondshistorySize
- size of history sampleresetOnSample
- true to reset value on sampleinitValue
- initial valuesampleNow
- true to record smaple immediatelyMethod Detail |
---|
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
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |