public class DefaultLongTaskTimer extends AbstractMeter implements LongTaskTimer
LongTaskTimer.Builder, LongTaskTimer.SampleMeter.Id, Meter.Type| Constructor and Description |
|---|
DefaultLongTaskTimer(Meter.Id id,
Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
int |
activeTasks() |
double |
duration(long task,
java.util.concurrent.TimeUnit unit)
The current duration for an active task.
|
double |
duration(java.util.concurrent.TimeUnit unit) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
LongTaskTimer.Sample |
start()
Start keeping time for a task.
|
long |
stop(long task)
Mark a given task as completed.
|
getIdclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitbuilder, builder, measure, record, record, record, recordCallablepublic LongTaskTimer.Sample start()
LongTaskTimerstart in interface LongTaskTimerpublic long stop(long task)
LongTaskTimerstop in interface LongTaskTimertask - Id for the task to stop. This should be the value returned from LongTaskTimer.start().public double duration(long task,
java.util.concurrent.TimeUnit unit)
LongTaskTimerduration in interface LongTaskTimertask - Id for the task to stop. This should be the value returned from LongTaskTimer.start().unit - The time unit to scale the duration to.public double duration(java.util.concurrent.TimeUnit unit)
duration in interface LongTaskTimerunit - The time unit to scale the duration to.public int activeTasks()
activeTasks in interface LongTaskTimerpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object