Timer.Builder, Timer.SampleMeter.Id, Meter.Type| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.TimeUnit |
baseTimeUnit() |
long |
count() |
double |
histogramCountAtValue(long valueNanos)
Provides cumulative histogram counts.
|
double |
max(java.util.concurrent.TimeUnit unit) |
double |
percentile(double percentile,
java.util.concurrent.TimeUnit unit) |
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.
|
HistogramSnapshot |
takeSnapshot(boolean supportsAggregablePercentiles)
Summary statistics should be published off of a single snapshot instance so that, for example, there isn't
disagreement between the distribution's count and total because more events continue to stream in.
|
double |
totalTime(java.util.concurrent.TimeUnit unit) |
getIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic NoopTimer(Meter.Id id)
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 TimerT - The return type of the Callable.f - Function to execute and measure the execution time.java.lang.Exception - Any exception bubbling up from the callable.public void record(java.lang.Runnable f)
Timerpublic long count()
public double totalTime(java.util.concurrent.TimeUnit unit)
public double max(java.util.concurrent.TimeUnit unit)
public double percentile(double percentile,
java.util.concurrent.TimeUnit unit)
percentile in interface Timerpercentile - A percentile in the domain [0, 1]. For example, 0.5 represents the 50th percentile of the
distribution.unit - The base unit of time to scale the percentile value to.public double histogramCountAtValue(long valueNanos)
TimerhistogramCountAtValue in interface TimervalueNanos - The histogram bucket to retrieve a count for.public java.util.concurrent.TimeUnit baseTimeUnit()
baseTimeUnit in interface Timerpublic HistogramSnapshot takeSnapshot(boolean supportsAggregablePercentiles)
TimertakeSnapshot in interface TimersupportsAggregablePercentiles - Whether percentile histogram buckets should be included in the list of CountAtBucket.