@Vetoed public class TimerImpl extends Object implements org.eclipse.microprofile.metrics.Timer
Meter.
The timer measures duration in nanoseconds.| Constructor and Description |
|---|
TimerImpl()
|
TimerImpl(Clock clock)
|
TimerImpl(Reservoir reservoir)
|
TimerImpl(Reservoir reservoir,
Clock clock)
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
Duration |
getElapsedTime() |
double |
getFifteenMinuteRate() |
double |
getFiveMinuteRate() |
double |
getMeanRate() |
double |
getOneMinuteRate() |
org.eclipse.microprofile.metrics.Snapshot |
getSnapshot() |
org.eclipse.microprofile.metrics.Timer.Context |
time()
Returns a new
Context. |
<T> T |
time(Callable<T> event)
Times and records the duration of event.
|
void |
time(Runnable event)
Times and records the duration of event.
|
String |
toString() |
void |
update(Duration duration) |
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration.
|
public TimerImpl()
public TimerImpl(Clock clock)
clock - the Clock implementation the created timer should usepublic TimerImpl(Reservoir reservoir)
reservoir - the Reservoir implementation the timer should
usepublic void update(long duration,
TimeUnit unit)
duration - the length of the durationunit - the scale unit of durationpublic void update(Duration duration)
update in interface org.eclipse.microprofile.metrics.Timerpublic <T> T time(Callable<T> event) throws Exception
time in interface org.eclipse.microprofile.metrics.TimerT - the type of the value returned by eventevent - a Callable whose Callable.call() method
implements a process whose duration should be timedeventException - if event throws an Exceptionpublic void time(Runnable event)
time in interface org.eclipse.microprofile.metrics.Timerevent - a Runnable whose Runnable.run() method
implements a process whose duration should be timedpublic org.eclipse.microprofile.metrics.Timer.Context time()
Context.time in interface org.eclipse.microprofile.metrics.TimerContextContextpublic Duration getElapsedTime()
getElapsedTime in interface org.eclipse.microprofile.metrics.Timerpublic long getCount()
getCount in interface org.eclipse.microprofile.metrics.CountinggetCount in interface org.eclipse.microprofile.metrics.MeteredgetCount in interface org.eclipse.microprofile.metrics.Timerpublic double getFifteenMinuteRate()
getFifteenMinuteRate in interface org.eclipse.microprofile.metrics.MeteredgetFifteenMinuteRate in interface org.eclipse.microprofile.metrics.Timerpublic double getFiveMinuteRate()
getFiveMinuteRate in interface org.eclipse.microprofile.metrics.MeteredgetFiveMinuteRate in interface org.eclipse.microprofile.metrics.Timerpublic double getMeanRate()
getMeanRate in interface org.eclipse.microprofile.metrics.MeteredgetMeanRate in interface org.eclipse.microprofile.metrics.Timerpublic double getOneMinuteRate()
getOneMinuteRate in interface org.eclipse.microprofile.metrics.MeteredgetOneMinuteRate in interface org.eclipse.microprofile.metrics.Timerpublic org.eclipse.microprofile.metrics.Snapshot getSnapshot()
getSnapshot in interface org.eclipse.microprofile.metrics.SamplinggetSnapshot in interface org.eclipse.microprofile.metrics.TimerCopyright © 2021. All rights reserved.