E
- the element typepublic class SampledCounterProxy<E extends Number> extends Object implements SampledCounter
Modifier and Type | Field and Description |
---|---|
protected ExtendedStatistics.Statistic<E> |
rate
The rate.
|
Constructor and Description |
---|
SampledCounterProxy(ExtendedStatistics.Statistic<E> rate)
Instantiates a new sampled counter proxy.
|
Modifier and Type | Method and Description |
---|---|
long |
decrement()
Decrement the counter by 1
|
long |
decrement(long amount)
Decrement the counter by given amount
|
TimeStampedCounterValue[] |
getAllSampleValues()
Returns all samples in history
|
long |
getAndReset()
Returns the current value of the counter and resets it to 0
|
long |
getAndSet(long newValue)
Returns the value of the counter and sets it to the new value
|
TimeStampedCounterValue |
getMostRecentSample()
Returns the most recent sampled value
|
long |
getValue()
Gets current value of the counter
|
long |
increment()
Increment the counter by 1
|
long |
increment(long amount)
Increment the counter by given amount
|
void |
setValue(long newValue)
Sets the value of the counter to the supplied value
|
void |
shutdown()
Shutdown this counter
|
protected TimeStampedCounterValue[] |
sortAndPresent(List<TimeStampedCounterValue> arr)
Sort and present the List of values
|
protected final ExtendedStatistics.Statistic<E extends Number> rate
public SampledCounterProxy(ExtendedStatistics.Statistic<E> rate)
rate
- the ratepublic TimeStampedCounterValue getMostRecentSample()
SampledCounter
getMostRecentSample
in interface SampledCounter
public TimeStampedCounterValue[] getAllSampleValues()
SampledCounter
getAllSampleValues
in interface SampledCounter
protected TimeStampedCounterValue[] sortAndPresent(List<TimeStampedCounterValue> arr)
arr
- public void setValue(long newValue)
Counter
public long increment()
Counter
public long decrement()
Counter
public long getAndSet(long newValue)
Counter
public long getValue()
Counter
public long increment(long amount)
Counter
public long decrement(long amount)
Counter
public void shutdown()
SampledCounter
shutdown
in interface SampledCounter
public long getAndReset()
SampledCounter
getAndReset
in interface SampledCounter
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.