public class Timer extends Counter
Examples
DB Query duration
rendering duration
parsing time of xml input
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.log4j.Logger |
LOGGER |
private AtomicLong |
timerSum |
private AtomicLong |
timerSumOfSquares |
| Constructor and Description |
|---|
Timer(String name)
This class is only constructed by
InApplicationMonitor |
| Modifier and Type | Method and Description |
|---|---|
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
|
private static final org.apache.log4j.Logger LOGGER
private final AtomicLong timerSum
private final AtomicLong timerSumOfSquares
Timer(String name)
InApplicationMonitorname - name of this Timerpublic 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()
Copyright © 2013 Immobilien Scout GmbH. All Rights Reserved.