public class TimerBasicStatistics extends Object implements Comparable<TimerBasicStatistics>
Currently tracked statistics are:
Constructor and Description |
---|
TimerBasicStatistics(String taskName)
Create an empty statistics instance for the task.
|
TimerBasicStatistics(Timer timer)
Create a statistics instance and initialize with the values from the
Timer provided. |
Modifier and Type | Method and Description |
---|---|
void |
addTimer(Timer timer)
Add the results of a timer to the currently tracked statistics for this
timer.
|
int |
compareTo(TimerBasicStatistics o) |
boolean |
equals(Object obj) |
double |
getAverageElapsed(TimeUnit timeUnit)
Return the average elapsed time recorded for this task.
|
double |
getAverageElapsedNanos()
Return the average elapsed time recorded for this task in nanoseconds.
|
int |
getCount()
Return the number of times this instance has been updated with timer
values.
|
long |
getMaxElapsed(TimeUnit timeUnit)
Return the maximum time recorded for this task.
|
long |
getMaxElapsedNanos()
Return the maximum number of elapsed nanoseconds recorded for this task.
|
long |
getMinElapsed(TimeUnit timeUnit)
Return the minimum time recorded for this task.
|
long |
getMinElapsedNanos()
Return the minimum number of elapsed nanoseconds recorded for this task.
|
TimerBasicStatistics |
getSnapshot()
Creates a snapshot of the instance and returns as a new instance.
|
double |
getStdDevElapsed(TimeUnit timeUnit)
Return the standard deviation of elapsed times recorded for this task.
|
double |
getStdDevElapsedNanos()
Return the standard deviation of elapsed times recorded for this task in nanoseconds.
|
String |
getTaskName()
Return the task name for which the statistics are being tracked.
|
long |
getTotalElapsed(TimeUnit timeUnit)
Return the accumulated time recorded for this task.
|
long |
getTotalElapsedNanos()
Return the accumulated number of elapsed nanoseconds recorded for this
task.
|
double |
getVarianceElapsed(TimeUnit timeUnit)
Return the variance of elapsed times recorded for this task.
|
double |
getVarianceElapsedNanos()
Return the variance of elapsed times recorded for this task in nanoseconds.
|
int |
hashCode() |
String |
toString() |
public TimerBasicStatistics(String taskName)
taskName
- public void addTimer(Timer timer)
timer
- IllegalArgumentException
- if the Timer.getTaskName()
does not match
taskName
public String getTaskName()
public int getCount()
public long getTotalElapsedNanos()
public long getTotalElapsed(TimeUnit timeUnit)
TimeUnit
provided.timeUnit
- Desired time unit for returned value.public long getMinElapsedNanos()
Long.MAX_VALUE
if no timers have yet been recorded.public long getMinElapsed(TimeUnit timeUnit)
TimeUnit
provided.timeUnit
- Desired time unit for returned value.public long getMaxElapsedNanos()
Long.MIN_VALUE
if no timers have yet been recorded.public long getMaxElapsed(TimeUnit timeUnit)
TimeUnit
provided.timeUnit
- Desired time unit for returned value.public double getAverageElapsedNanos()
public double getAverageElapsed(TimeUnit timeUnit)
TimeUnit
provided.
May lose precision as fractional portion of mean will be truncated in conversion method.
timeUnit
- Desired time unit for returned value.TimeUnit
provided.public double getVarianceElapsedNanos()
public double getVarianceElapsed(TimeUnit timeUnit)
TimeUnit
provided.
May lose precision as fractional portion of variance will be truncated in conversion method.
timeUnit
- Desired time unit for returned value.TimeUnit
provided.public double getStdDevElapsedNanos()
public double getStdDevElapsed(TimeUnit timeUnit)
TimeUnit
provided.
May lose precision as fractional portion of variance will be truncated in conversion method.
timeUnit
- Desired time unit for returned value.TimeUnit
provided.public TimerBasicStatistics getSnapshot()
TimerBasicStatistics
that is a snapshot
at the time returned.public int compareTo(TimerBasicStatistics o)
compareTo
in interface Comparable<TimerBasicStatistics>
Copyright © 2014. All Rights Reserved.