Constructor and Description |
---|
TimeRecorder(int numberRecentObservations)
Create a new statistic recorder
|
Modifier and Type | Method and Description |
---|---|
void |
addObservation(Long milliseconds)
Add an observation.
|
void |
addObservation(long duration,
TimeUnit unit)
Add an observation.
|
long |
getAverage() |
long |
getLastObservation() |
long |
getMaximum() |
long |
getMinimun() |
long |
getNumberOfObservations() |
long |
getRecentAverage() |
long |
getRecentMaximum() |
long |
getRecentMinimum() |
void |
reset()
Clear all data recorded so far.
|
public TimeRecorder(int numberRecentObservations)
numberRecentObservations
- number of observations that are not aggregated and can be
retrieved via the getRecent*
methods.public void addObservation(Long milliseconds)
addObservation
in interface Recorder<Long>
milliseconds
- Duration of the observation in millisecondspublic void addObservation(long duration, TimeUnit unit)
duration
- Duration of the observationunit
- TimeUnit
of the observation.public long getNumberOfObservations()
public long getMaximum()
0
if
there are no observations yet.public long getMinimun()
0
if
there are no observations yet.public long getAverage()
0
if
there are no observations yet.public long getRecentMaximum()
0
if
there are no observations yet.public long getRecentMinimum()
0
if
there are no observations yet.public long getRecentAverage()
0
if
there are no observations yet.public long getLastObservation()
0
if there are no
observations yet.Copyright © 2017 levigo holding gmbh. All rights reserved.