Package org.apache.mina.filter.statistic
Class ProfilerTimerFilter.TimerWorker
- java.lang.Object
-
- org.apache.mina.filter.statistic.ProfilerTimerFilter.TimerWorker
-
- Enclosing class:
- ProfilerTimerFilter
private class ProfilerTimerFilter.TimerWorker extends java.lang.ObjectClass that will track the time each method takes and be able to provide information for each method.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicLongcallsNumberThe number of callsprivate java.lang.ObjectlockA lock for synchinized blocksprivate java.util.concurrent.atomic.AtomicLongmaximumThe slowest operationprivate java.util.concurrent.atomic.AtomicLongminimumThe fastest operationprivate java.util.concurrent.atomic.AtomicLongtotalThe sum of all operation durations
-
Constructor Summary
Constructors Constructor Description TimerWorker()Creates a new instance of TimerWorker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNewDuration(long duration)Add a new operation duration to this class.doublegetAverage()Gets the average reading for this eventlonggetCallsNumber()longgetMaximum()longgetMinimum()longgetTotal()
-
-
-
Field Detail
-
total
private final java.util.concurrent.atomic.AtomicLong total
The sum of all operation durations
-
callsNumber
private final java.util.concurrent.atomic.AtomicLong callsNumber
The number of calls
-
minimum
private final java.util.concurrent.atomic.AtomicLong minimum
The fastest operation
-
maximum
private final java.util.concurrent.atomic.AtomicLong maximum
The slowest operation
-
lock
private final java.lang.Object lock
A lock for synchinized blocks
-
-
Method Detail
-
addNewDuration
public void addNewDuration(long duration)
Add a new operation duration to this class. Total is updated and calls is incremented- Parameters:
duration- The new operation duration
-
getAverage
public double getAverage()
Gets the average reading for this event- Returns:
- the average reading for this event
-
getCallsNumber
public long getCallsNumber()
- Returns:
- The total number of profiled operation
-
getTotal
public long getTotal()
- Returns:
- the total time
-
getMinimum
public long getMinimum()
- Returns:
- the lowest execution time
-
getMaximum
public long getMaximum()
- Returns:
- the longest execution time
-
-