| Modifier and Type | Interface and Description |
|---|---|
static interface |
Timer.Context
A timing context.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount()
Returns the number of events which have been marked.
|
double |
getFifteenMinuteRate()
Returns the fifteen-minute exponentially-weighted moving average rate at which events have
occurred since the meter was created.
|
double |
getFiveMinuteRate()
Returns the five-minute exponentially-weighted moving average rate at which events have
occurred since the meter was created.
|
double |
getMeanRate()
Returns the mean rate at which events have occurred since the meter was created.
|
double |
getOneMinuteRate()
Returns the one-minute exponentially-weighted moving average rate at which events have
occurred since the meter was created.
|
Snapshot |
getSnapshot()
Returns a snapshot of the values.
|
Timer.Context |
time()
Returns a new
Timer.Context. |
<T> T |
time(java.util.concurrent.Callable<T> event)
Times and records the duration of event.
|
void |
time(java.lang.Runnable event)
Times and records the duration of event.
|
void |
update(long duration,
java.util.concurrent.TimeUnit unit)
Adds a recorded duration.
|
void update(long duration,
java.util.concurrent.TimeUnit unit)
duration - the length of the durationunit - the scale unit of duration<T> T time(java.util.concurrent.Callable<T> event)
throws java.lang.Exception
T - the type of the value returned by eventevent - a Callable whose Callable.call() method implements a process
whose duration should be timedeventjava.lang.Exception - if event throws an Exceptionvoid time(java.lang.Runnable event)
event - a Runnable whose Runnable.run() method implements a process
whose duration should be timedTimer.Context time()
Timer.Context.Timer.ContextTimer.Contextlong getCount()
Metereddouble getFifteenMinuteRate()
Meteredtop Unix command.getFifteenMinuteRate in interface Metereddouble getFiveMinuteRate()
Meteredtop Unix command.getFiveMinuteRate in interface Metereddouble getMeanRate()
MeteredgetMeanRate in interface Metereddouble getOneMinuteRate()
Meteredtop Unix command.getOneMinuteRate in interface MeteredSnapshot getSnapshot()
SamplinggetSnapshot in interface Sampling