Class Statistic
- java.lang.Object
-
- org.apache.camel.management.mbean.Statistic
-
- Direct Known Subclasses:
StatisticCounter
,StatisticDelta
,StatisticMaximum
,StatisticMinimum
,StatisticValue
public abstract class Statistic extends Object
Base implementation ofStatistic
The following modes is available:- VALUE - A statistic with this update mode is a simple value that is a straight forward representation of the updated value.
- DELTA - A statistic with this update mode is a value that represents the delta between the last two recorded values (or the initial value if two updates have not been recorded). This value can be negative if the delta goes up or down.
- COUNTER - A statistic with this update mode interprets updates as increments (positive values) or decrements (negative values) to the current value.
- MAXIMUM - A statistic with this update mode is a value that represents the maximum value amongst the update values applied to this statistic.
- MINIMUM - A statistic with this update mode is a value that represents the minimum value amongst the update values applied to this statistic.
-
The MAXIMUM and MINIMUM modes are not 100% thread-safe as there can be a lost-update problem. This is on purpose
because the performance overhead to ensure atomic updates costs to much on CPU and memory footprint. The other modes
are thread-safe.
-
-
Constructor Summary
Constructors Constructor Description Statistic()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
decrement()
abstract long
getValue()
void
increment()
abstract boolean
isUpdated()
Whether the statistic has been updated one or more times.abstract void
reset()
abstract void
updateValue(long newValue)
-
-
-
Constructor Detail
-
Statistic
public Statistic()
-
-
Method Detail
-
updateValue
public abstract void updateValue(long newValue)
-
increment
public void increment()
-
decrement
public void decrement()
-
getValue
public abstract long getValue()
-
isUpdated
public abstract boolean isUpdated()
Whether the statistic has been updated one or more times. Notice this is only working for value, maximum and minimum modes.
-
reset
public abstract void reset()
-
-