Timer.BuilderMeter.Id, Meter.Type| Modifier and Type | Method and Description |
|---|---|
long |
count()
The number of times that record has been called since this timer was created.
|
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.
|
double |
totalTime(java.util.concurrent.TimeUnit unit)
The total time of all recorded events since this timer was created.
|
<T> java.util.concurrent.Callable<T> |
wrap(java.util.concurrent.Callable<T> f)
Wrap a
Callable so that it is timed when invoked. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final NoopTimer INSTANCE
public void record(long amount,
java.util.concurrent.TimeUnit unit)
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 <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> f)
TimerCallable so that it is timed when invoked.public long count()
Timer