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()
SampledCountergetMostRecentSample in interface SampledCounterpublic TimeStampedCounterValue[] getAllSampleValues()
SampledCountergetAllSampleValues in interface SampledCounterprotected TimeStampedCounterValue[] sortAndPresent(List<TimeStampedCounterValue> arr)
arr - public void setValue(long newValue)
Counterpublic long increment()
Counterpublic long decrement()
Counterpublic long getAndSet(long newValue)
Counterpublic long getValue()
Counterpublic long increment(long amount)
Counterpublic long decrement(long amount)
Counterpublic void shutdown()
SampledCountershutdown in interface SampledCounterpublic long getAndReset()
SampledCountergetAndReset in interface SampledCounterCopyright 2001-2021, Terracotta, Inc.