public final class StatsTracker
extends java.lang.Object
Constructor and Description |
---|
StatsTracker() |
Modifier and Type | Method and Description |
---|---|
void |
count(Stat name,
int count)
Inserts value for first call and sum values for consequent calls.
|
java.util.Map<Stat,java.lang.Integer> |
getCounters() |
java.util.Map<Stat,com.google.common.base.Stopwatch> |
getTimers() |
void |
startHkTimer(Stat name)
Special methods for tracking time in HK2 scope.
|
void |
stopHkTimer(Stat name)
Called to stop currently measured HK2 metric (also stops main guice and HK2 timers).
|
com.google.common.base.Stopwatch |
timer(Stat name)
If measured first time, returns new instance.
|
public com.google.common.base.Stopwatch timer(Stat name)
name
- statistic namepublic void count(Stat name, int count)
name
- statistics namecount
- counter valuepublic void startHkTimer(Stat name)
name
- HK2 statistics namepublic void stopHkTimer(Stat name)
name
- HK2 statistic namepublic java.util.Map<Stat,com.google.common.base.Stopwatch> getTimers()
public java.util.Map<Stat,java.lang.Integer> getCounters()