|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.is24.util.monitoring.Counter
de.is24.util.monitoring.Timer
public class Timer
Currently a subclass of counter although this makes no sense and should be refactored
Timers count and measure timed events.
Timers allow adding timer measurements, implicitly incrementing the count
Examples
DB Query duration
rendering duration
parsing time of xml input
| Field Summary | |
|---|---|
private static org.apache.log4j.Logger |
LOGGER
|
private AtomicLong |
timerSum
|
private AtomicLong |
timerSumOfSquares
|
| Constructor Summary | |
|---|---|
Timer(String name)
This class is only constructed by InApplicationMonitor |
|
| Method Summary | |
|---|---|
void |
accept(ReportVisitor aVisitor)
Implements the visitor pattern to read this StateValueProvider |
void |
addMeasurement(long durationInMillis)
Add a timer measurement for this timer. The application decides which unit to use for timing. |
double |
getTimerAvg()
Note that this calculation might be notably inconsistent unless there are many measurements as a timer is not atomic. |
double |
getTimerStdDev()
Note that this calculation might be notably inconsistent unless there are many measurements as a timer is not atomic. |
long |
getTimerSum()
|
void |
initializeMeasurement()
initialize with 0 |
| Methods inherited from class de.is24.util.monitoring.Counter |
|---|
getCount, getName, increment, increment, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.apache.log4j.Logger LOGGER
private final AtomicLong timerSum
private final AtomicLong timerSumOfSquares
| Constructor Detail |
|---|
Timer(String name)
InApplicationMonitor
name - name of this Timer| Method Detail |
|---|
public void accept(ReportVisitor aVisitor)
accept in interface Reportableaccept in class Counterpublic void addMeasurement(long durationInMillis)
ReportVisitor implementations
may imply this.
durationInMillis - public void initializeMeasurement()
public long getTimerSum()
public double getTimerAvg()
public double getTimerStdDev()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||