public class SampledRateCounterImpl extends SampledCounterImpl implements SampledRateCounter
SampledRateCounter
Modifier and Type | Field and Description |
---|---|
private long |
denominatorValue |
private long |
numeratorValue |
private static java.lang.String |
OPERATION_NOT_SUPPORTED_MSG |
history, resetOnSample
Constructor and Description |
---|
SampledRateCounterImpl(SampledRateCounterConfig config)
Constructor accepting the config
|
Modifier and Type | Method and Description |
---|---|
long |
decrement()
throws
UnsupportedOperationException |
long |
decrement(long amount)
throws
UnsupportedOperationException |
void |
decrement(long numerator,
long denominator)
Decrements the numerator and denominator by the passed values
|
long |
getAndReset()
Returns the current value of the counter and resets it to 0
|
long |
getAndSet(long newValue)
throws
UnsupportedOperationException |
long |
getMaxValue()
throws
UnsupportedOperationException |
long |
getMinValue()
throws
UnsupportedOperationException |
long |
getValue()
Gets current value of the counter
|
long |
increment()
throws
UnsupportedOperationException |
long |
increment(long amount)
throws
UnsupportedOperationException |
void |
increment(long numerator,
long denominator)
Increments the numerator and denominator by the passed values
|
void |
setDenominatorValue(long newValue)
Sets the value of the denominator to the passed value
|
void |
setNumeratorValue(long newValue)
Sets the value of the numerator to the passed value
|
void |
setValue(long newValue)
throws
UnsupportedOperationException |
void |
setValue(long numerator,
long denominator)
Sets the values of the numerator and denominator to the passed values
|
getAllSampleValues, getIntervalMillis, getMostRecentSample, getTimerTask, recordSample, shutdown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllSampleValues, getMostRecentSample, shutdown
private static final java.lang.String OPERATION_NOT_SUPPORTED_MSG
private long numeratorValue
private long denominatorValue
public SampledRateCounterImpl(SampledRateCounterConfig config)
config
- public void setValue(long numerator, long denominator)
setValue
in interface SampledRateCounter
public void increment(long numerator, long denominator)
increment
in interface SampledRateCounter
public void decrement(long numerator, long denominator)
decrement
in interface SampledRateCounter
public void setDenominatorValue(long newValue)
setDenominatorValue
in interface SampledRateCounter
public void setNumeratorValue(long newValue)
setNumeratorValue
in interface SampledRateCounter
public long getValue()
getValue
in interface Counter
getValue
in class CounterImpl
public long getAndReset()
getAndReset
in interface SampledCounter
getAndReset
in class SampledCounterImpl
public long getAndSet(long newValue)
UnsupportedOperationException
getAndSet
in interface Counter
getAndSet
in class CounterImpl
public void setValue(long newValue)
UnsupportedOperationException
setValue
in interface Counter
setValue
in class CounterImpl
public long decrement()
UnsupportedOperationException
decrement
in interface Counter
decrement
in class CounterImpl
public long decrement(long amount)
UnsupportedOperationException
decrement
in interface Counter
decrement
in class CounterImpl
public long getMaxValue()
UnsupportedOperationException
public long getMinValue()
UnsupportedOperationException
public long increment()
UnsupportedOperationException
increment
in interface Counter
increment
in class CounterImpl
public long increment(long amount)
UnsupportedOperationException
increment
in interface Counter
increment
in class CounterImpl