|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.counter.RateCounterImpl
public class RateCounterImpl
A simple atomic rate counter implementation.
| Constructor Summary | |
|---|---|
RateCounterImpl()
Creates a new counter with both denominator and numerator at 0. |
|
RateCounterImpl(long numerator,
long denominator)
Create a new counter with a defined denominator and numerator. |
|
| Method Summary | |
|---|---|
void |
decrement(long numerator,
long denominator)
Decrement the numerator and denominator by the given amounts. |
long |
getAndReset()
Get the current and then reset this statistic. |
long |
getValue()
Get the current value. |
void |
increment(long numerator,
long denominator)
Increment the numerator and denominator by the given amounts. |
void |
setDenominatorValue(long newValue)
Set the denominator to the given value. |
void |
setNumeratorValue(long newValue)
Set the numerator to the given value. |
void |
setValue(long numerator,
long denominator)
Set the numerator and denominator to the given values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RateCounterImpl()
public RateCounterImpl(long numerator,
long denominator)
numerator - the inital numerator valuedenominator - the initial denominator value| Method Detail |
|---|
public void setValue(long numerator,
long denominator)
RateCounter
setValue in interface RateCounternumerator - new numerator valuedenominator - new denominator value
public void increment(long numerator,
long denominator)
RateCounter
increment in interface RateCounter
public void decrement(long numerator,
long denominator)
RateCounter
decrement in interface RateCounterpublic void setDenominatorValue(long newValue)
RateCounter
setDenominatorValue in interface RateCounternewValue - new denominator valuepublic void setNumeratorValue(long newValue)
RateCounter
setNumeratorValue in interface RateCounternewValue - new numerator valuepublic long getValue()
getValue in interface Statisticpublic long getAndReset()
getAndReset in interface Statistic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||