ehcache

net.sf.ehcache.util.counter.sampled
Interface SampledCounter

All Superinterfaces:
Counter
All Known Subinterfaces:
SampledRateCounter
All Known Implementing Classes:
SampledCounterImpl, SampledCounterProxy, SampledRateCounterImpl, SampledRateCounterProxy

public interface SampledCounter
extends Counter

Interface of a sampled counter -- a counter that keeps sampled values

Since:
1.7
Author:
Abhishek Sanoujam

Method Summary
 TimeStampedCounterValue[] getAllSampleValues()
          Returns all samples in history
 long getAndReset()
          Returns the current value of the counter and resets it to 0
 TimeStampedCounterValue getMostRecentSample()
          Returns the most recent sampled value
 void shutdown()
          Shutdown this counter
 
Methods inherited from interface net.sf.ehcache.util.counter.Counter
decrement, decrement, getAndSet, getValue, increment, increment, setValue
 

Method Detail

shutdown

void shutdown()
Shutdown this counter


getMostRecentSample

TimeStampedCounterValue getMostRecentSample()
Returns the most recent sampled value

Returns:
Value of the most recent sampled value

getAllSampleValues

TimeStampedCounterValue[] getAllSampleValues()
Returns all samples in history

Returns:
An array containing the TimeStampedCounterValue's

getAndReset

long getAndReset()
Returns the current value of the counter and resets it to 0

Returns:
current value of the counter

ehcache

Copyright 2001-2017, Terracotta, Inc.