public class CompositeTimer extends AbstractMeter implements Timer, CompositeMeter
Timer.BuilderMeter.Id, Meter.Type| Modifier and Type | Method and Description |
|---|---|
void |
add(MeterRegistry registry) |
long |
count()
The number of times that record has been called on this timer.
|
double |
histogramCountAtValue(long valueNanos) |
double |
max(java.util.concurrent.TimeUnit unit)
The maximum time of a single event.
|
double |
percentile(double percentile,
java.util.concurrent.TimeUnit unit)
The latency at a specific percentile.
|
void |
record(java.time.Duration duration)
Updates the statistics kept by the counter with the specified amount.
|
void |
record(long amount,
java.util.concurrent.TimeUnit unit)
Updates the statistics kept by the counter with the specified amount.
|
void |
record(java.lang.Runnable f)
Executes the runnable `f` and records the time taken.
|
<T> T |
record(java.util.function.Supplier<T> f)
Executes the Supplier `f` and records the time taken.
|
<T> T |
recordCallable(java.util.concurrent.Callable<T> f)
Executes the callable `f` and records the time taken.
|
void |
remove(MeterRegistry registry) |
double |
totalTime(java.util.concurrent.TimeUnit unit)
The total time of recorded events.
|
<T> java.util.concurrent.Callable<T> |
wrap(java.util.concurrent.Callable<T> f)
Wrap a
Callable so that it is timed when invoked. |
java.lang.Runnable |
wrap(java.lang.Runnable f)
Wrap a
Runnable so that it is timed when invoked. |
getIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic void record(long amount,
java.util.concurrent.TimeUnit unit)
Timerpublic void record(java.time.Duration duration)
Timerpublic <T> T record(java.util.function.Supplier<T> f)
Timerpublic <T> T recordCallable(java.util.concurrent.Callable<T> f)
throws java.lang.Exception
TimerrecordCallable in interface Timerf - Function to execute and measure the execution time.java.lang.Exceptionpublic void record(java.lang.Runnable f)
Timerpublic java.lang.Runnable wrap(java.lang.Runnable f)
TimerRunnable so that it is timed when invoked.public <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> f)
TimerCallable so that it is timed when invoked.public long count()
Timerpublic double totalTime(java.util.concurrent.TimeUnit unit)
Timerpublic double max(java.util.concurrent.TimeUnit unit)
Timerpublic double percentile(double percentile,
java.util.concurrent.TimeUnit unit)
Timerpercentile in interface Timerpublic double histogramCountAtValue(long valueNanos)
histogramCountAtValue in interface Timerpublic void add(MeterRegistry registry)
add in interface CompositeMeterpublic void remove(MeterRegistry registry)
remove in interface CompositeMeter