| 限定符和类型 | 类和说明 |
|---|---|
static class |
Timer.Context
A timing context.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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(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 Timer()
public Timer(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 <T> T time(Callable<T> event) throws Exception
T - 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)
event - a Runnable whose Runnable.run() method implements a process
whose duration should be timedpublic Timer.Context time()
Timer.Context.Timer.ContextTimer.Contextpublic long getCount()
Meteredpublic double getFifteenMinuteRate()
Meteredtop Unix command.getFifteenMinuteRate 在接口中 Meteredpublic double getFiveMinuteRate()
Meteredtop Unix command.getFiveMinuteRate 在接口中 Meteredpublic double getMeanRate()
MeteredgetMeanRate 在接口中 Meteredpublic double getOneMinuteRate()
Meteredtop Unix command.getOneMinuteRate 在接口中 Meteredpublic Snapshot getSnapshot()
SamplinggetSnapshot 在接口中 SamplingCopyright © 2020. All rights reserved.