- All Superinterfaces:
Instrument
A counter for registering long measurements that can be incremented/decreased.
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long value) Adds a value to the counter.intdecrements the counter and gets the value as an int.longdecrements the counter and gets the value as a long.getMeter()getUnit()intlongintincrements the counter and gets the value as an int.longincrements the counter and gets the value as a long.Methods inherited from interface org.mule.metrics.api.instrument.Instrument
getDescription, getName, reset
-
Method Details
-
add
void add(long value) Adds a value to the counter.- Parameters:
value- The increment amount. May be positive, negative or zero.
-
getValueAsLong
long getValueAsLong()- Returns:
- the value for the counter as a long.
-
getValueAsInt
int getValueAsInt()- Returns:
- the value for the counter as a int.
-
getUnit
String getUnit()- Returns:
- the unit for this measurement.
-
getMeter
Meter getMeter()- Specified by:
getMeterin interfaceInstrument- Returns:
- the
Meter.
-
incrementAndGetAsInt
int incrementAndGetAsInt()increments the counter and gets the value as an int.- Returns:
- the resulting value as int.
-
incrementAndGetAsLong
long incrementAndGetAsLong()increments the counter and gets the value as a long.- Returns:
- the resulting value as long.
-
decrementAndGetAsInt
int decrementAndGetAsInt()decrements the counter and gets the value as an int.- Returns:
- the resulting value as int.
-
decrementAndGetAsLong
long decrementAndGetAsLong()decrements the counter and gets the value as a long.- Returns:
- the resulting value as long.
-