Class ProfilerTimerFilter.TimerWorker
java.lang.Object
org.apache.mina.filter.statistic.ProfilerTimerFilter.TimerWorker
- Enclosing class:
ProfilerTimerFilter
Class that will track the time each method takes and be able to provide information for each method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicLongThe number of callsprivate final ObjectA lock for synchinized blocksprivate final AtomicLongThe slowest operationprivate final AtomicLongThe fastest operationprivate final AtomicLongThe sum of all operation durations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewDuration(long duration) Add a new operation duration to this class.doubleGets the average reading for this eventlonglonglonglonggetTotal()
-
Field Details
-
total
The sum of all operation durations -
callsNumber
The number of calls -
minimum
The fastest operation -
maximum
The slowest operation -
lock
A lock for synchinized blocks
-
-
Constructor Details
-
TimerWorker
public TimerWorker()Creates a new instance of TimerWorker.
-
-
Method Details
-
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
-