public final class LongTaskTimer extends Object implements LongTaskTimer
| Modifier and Type | Method and Description |
|---|---|
int |
activeTasks()
Returns the current number of tasks being executed.
|
long |
duration()
Returns the cumulative duration of all current tasks in nanoseconds.
|
long |
duration(long task)
Returns the current duration for a given active task.
|
static LongTaskTimer |
get(Registry registry,
Id id)
Creates a timer for tracking long running tasks.
|
boolean |
hasExpired()
Indicates whether the meter is expired.
|
Id |
id()
Identifier used to lookup this meter in the registry.
|
Iterable<Measurement> |
measure()
Get the set of measurements for this meter.
|
long |
start()
Start keeping time for a task and return a task id that can be used to look up how long
it has been running.
|
long |
stop(long task)
Indicates that a given task has completed.
|
public static LongTaskTimer get(Registry registry, Id id)
registry - Registry to use.id - Identifier for the metric being registered.public Id id()
Meterpublic boolean hasExpired()
MeterhasExpired in interface Meterpublic long 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 long duration(long task)
LongTaskTimerduration in interface LongTaskTimertask - Id for the task to stop. This should be the value returned from LongTaskTimer.start().public long duration()
LongTaskTimerduration in interface LongTaskTimerpublic int activeTasks()
LongTaskTimeractiveTasks in interface LongTaskTimerpublic Iterable<Measurement> measure()
Meter