Top Description Fields Constructors Methods
net.sf.ehcache.management.sampled

public Class SampledCounterProxy<E extends java.lang.Number>

extends Object
implements SampledCounter
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.util.counter.sampled.SampledCounter, net.sf.ehcache.util.counter.Counter
Known Direct Subclasses
net.sf.ehcache.management.sampled.SampledRateCounterProxy
Type Parameters
<E>
the element type
Imports
java.util.ArrayList, .Collections, .Comparator, .List, net.sf.ehcache.statistics.extended.ExtendedStatistics.Statistic, net.sf.ehcache.util.counter.sampled.SampledCounter, .TimeStampedCounterValue, org.terracotta.statistics.archive.Timestamped

The Class SampledCounterProxy.
Author
cschanck

Field Summary

Modifier and TypeField and Description
protected final ExtendedStatistics.Statistic<E>
rate

The rate.

Constructor Summary

AccessConstructor and Description
public
SampledCounterProxy(ExtendedStatistics.Statistic<E>
the rate
rate
)

Instantiates a new sampled counter proxy.

Method Summary

Modifier and TypeMethod and Description
public long
decrement()

Implements net.sf.ehcache.util.counter.Counter.decrement.

Decrement the counter by 1
public long
decrement(long amount)

Implements net.sf.ehcache.util.counter.Counter.decrement.

Decrement the counter by given amount
public TimeStampedCounterValue[]
public long
getAndReset()

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.getAndReset.

Returns the current value of the counter and resets it to 0
public long
getAndSet(long newValue)

Implements net.sf.ehcache.util.counter.Counter.getAndSet.

Returns the value of the counter and sets it to the new value
public TimeStampedCounterValue
public long
getValue()

Implements net.sf.ehcache.util.counter.Counter.getValue.

Gets current value of the counter
public long
increment()

Implements net.sf.ehcache.util.counter.Counter.increment.

Increment the counter by 1
public long
increment(long amount)

Implements net.sf.ehcache.util.counter.Counter.increment.

Increment the counter by given amount
public void
setValue(long newValue)

Implements net.sf.ehcache.util.counter.Counter.setValue.

Sets the value of the counter to the supplied value
public void
protected TimeStampedCounterValue[]
sortAndPresent(List<TimeStampedCounterValue> arr)

Sort and present the List of values

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rateback to summary
protected final ExtendedStatistics.Statistic<E> rate

The rate.

Constructor Detail

SampledCounterProxyback to summary
public SampledCounterProxy(ExtendedStatistics.Statistic<E> rate)

Instantiates a new sampled counter proxy.

Parameters
rate:ExtendedStatistics.Statistic<E>

the rate

Method Detail

decrementback to summary
public long decrement()

Implements net.sf.ehcache.util.counter.Counter.decrement.

Doc from net.sf.ehcache.util.counter.Counter.decrement.

Decrement the counter by 1

Returns:long

the value after decrementing

Annotations
@Override
decrementback to summary
public long decrement(long amount)

Implements net.sf.ehcache.util.counter.Counter.decrement.

Doc from net.sf.ehcache.util.counter.Counter.decrement.

Decrement the counter by given amount

Returns:long

the value of the counter after decrementing

Annotations
@Override
getAllSampleValuesback to summary
public TimeStampedCounterValue[] getAllSampleValues()

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.getAllSampleValues.

Doc from net.sf.ehcache.util.counter.sampled.SampledCounter.getAllSampleValues.

Returns all samples in history

Returns:TimeStampedCounterValue[]

An array containing the TimeStampedCounterValue's

Annotations
@Override
getAndResetback to summary
public long getAndReset()

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.getAndReset.

Doc from net.sf.ehcache.util.counter.sampled.SampledCounter.getAndReset.

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

Returns:long

current value of the counter

Annotations
@Override
getAndSetback to summary
public long getAndSet(long newValue)

Implements net.sf.ehcache.util.counter.Counter.getAndSet.

Doc from net.sf.ehcache.util.counter.Counter.getAndSet.

Returns the value of the counter and sets it to the new value

Returns:long

Returns the old value

Annotations
@Override
getMostRecentSampleback to summary
public TimeStampedCounterValue getMostRecentSample()

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.getMostRecentSample.

Doc from net.sf.ehcache.util.counter.sampled.SampledCounter.getMostRecentSample.

Returns the most recent sampled value

Returns:TimeStampedCounterValue

Value of the most recent sampled value

Annotations
@Override
getValueback to summary
public long getValue()

Implements net.sf.ehcache.util.counter.Counter.getValue.

Doc from net.sf.ehcache.util.counter.Counter.getValue.

Gets current value of the counter

Returns:long

current value of the counter

Annotations
@Override
incrementback to summary
public long increment()

Implements net.sf.ehcache.util.counter.Counter.increment.

Doc from net.sf.ehcache.util.counter.Counter.increment.

Increment the counter by 1

Returns:long

the value after incrementing

Annotations
@Override
incrementback to summary
public long increment(long amount)

Implements net.sf.ehcache.util.counter.Counter.increment.

Doc from net.sf.ehcache.util.counter.Counter.increment.

Increment the counter by given amount

Returns:long

the value of the counter after incrementing

Annotations
@Override
setValueback to summary
public void setValue(long newValue)

Implements net.sf.ehcache.util.counter.Counter.setValue.

Doc from net.sf.ehcache.util.counter.Counter.setValue.

Sets the value of the counter to the supplied value

Annotations
@Override
shutdownback to summary
public void shutdown()

Implements net.sf.ehcache.util.counter.sampled.SampledCounter.shutdown.

Doc from net.sf.ehcache.util.counter.sampled.SampledCounter.shutdown.

Shutdown this counter

Annotations
@Override
sortAndPresentback to summary
protected TimeStampedCounterValue[] sortAndPresent(List<TimeStampedCounterValue> arr)

Sort and present the List of values