public class TimerImpl extends Object implements org.eclipse.microprofile.metrics.Timer
MeterImpl.| Modifier and Type | Class and Description |
|---|---|
static class |
TimerImpl.Context
A timing context.
|
| Constructor and Description |
|---|
TimerImpl()
|
TimerImpl(Reservoir reservoir)
|
TimerImpl(Reservoir reservoir,
Clock clock)
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
double |
getFifteenMinuteRate() |
double |
getFiveMinuteRate() |
double |
getMeanRate() |
org.eclipse.microprofile.metrics.Metered |
getMeter() |
double |
getOneMinuteRate() |
org.eclipse.microprofile.metrics.Snapshot |
getSnapshot() |
TimerImpl.Context |
time()
Returns a new
TimerImpl.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.
|
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration.
|
public TimerImpl()
public TimerImpl(Reservoir reservoir)
reservoir - the Reservoir implementation the timer should usepublic void update(long duration,
TimeUnit unit)
update in interface org.eclipse.microprofile.metrics.Timerduration - the length of the durationunit - the scale unit of durationpublic <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 TimerImpl.Context time()
TimerImpl.Context.time in interface org.eclipse.microprofile.metrics.TimerTimerImpl.ContextTimerImpl.Contextpublic 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.Timerpublic org.eclipse.microprofile.metrics.Metered getMeter()
Copyright © 2018 JBoss by Red Hat. All rights reserved.