- Direct Known Subclasses:
- RepStatManager
public class StatManager
extends Object
The StatManager provides functionality to acquire incremental statistics.
A client registers itself and is returned a key. The key is used in
subsequent calls to acquire statistics. The key is associated with a base
set of statistic values. The base set is used to compute incremental
statistics. Incremental statistics are computed interval by subtracting
the base from the current set of values. The base values for the
registered contexts are updated when statistics are cleared.
For instance if you have a counter named X. The initial value is zero.
Suppose there are two statistic contexts registered S1
(say for statcapture)and S2 (for the public api loadStats). The counter
gets incremented to 10. S1 loads stats with clear=true. The statistic base
for the other stat contexts, S2 is updated. The value in the base for X
is set to (current value in base - current stat value) or (0 - 10). The
value returned for stat X with respect to context S1
(the caller of loadStat) is (current value of X - base value) or 10-0.
The value of X is cleared since getClear() =true. Later the value of X is
incremented (value is now 1). Statistics are loaded for stat context S2.
The value returned is current value - base value, or 1 - (-10) or 11.