Top Description Methods
net.sf.ehcache.util.counter.sampled

public Interface SampledCounter

extends Counter
Known Direct Subinterfaces
net.sf.ehcache.util.counter.sampled.SampledRateCounter
Known Direct Implementers
net.sf.ehcache.util.counter.sampled.SampledCounterImpl, net.sf.ehcache.management.sampled.SampledCounterProxy
Imports
net.sf.ehcache.util.counter.Counter

Interface of a sampled counter -- a counter that keeps sampled values
Author
Abhishek Sanoujam
Since
1.7

Method Summary

Modifier and TypeMethod and Description
public TimeStampedCounterValue[]

Returns:

An array containing the TimeStampedCounterValue's
getAllSampleValues
()

Returns all samples in history

public long

Returns:

current value of the counter
getAndReset
()

Returns the current value of the counter and resets it to 0

public TimeStampedCounterValue

Returns:

Value of the most recent sampled value
getMostRecentSample
()

Returns the most recent sampled value

public void
shutdown()

Shutdown this counter

Inherited from net.sf.ehcache.util.counter.Counter:
decrementdecrementgetAndSetgetValueincrementincrementsetValue

Method Detail

getAllSampleValuesback to summary
public TimeStampedCounterValue[] getAllSampleValues()

Returns all samples in history

Returns:TimeStampedCounterValue[]

An array containing the TimeStampedCounterValue's

getAndResetback to summary
public long getAndReset()

Returns the current value of the counter and resets it to 0

Returns:long

current value of the counter

getMostRecentSampleback to summary
public TimeStampedCounterValue getMostRecentSample()

Returns the most recent sampled value

Returns:TimeStampedCounterValue

Value of the most recent sampled value

shutdownback to summary
public void shutdown()

Shutdown this counter