Modifier and Type | Method and Description |
---|---|
long |
count()
The number of times that record has been called since this timer was created.
|
static PercentileTimer |
get(Registry registry,
Id id)
Creates a timer object that can be used for estimating percentiles.
|
boolean |
hasExpired()
Indicates whether the meter is expired.
|
Id |
id()
Identifier used to lookup this meter in the registry.
|
Iterable<Measurement> |
measure()
Get the set of measurements for this meter.
|
double |
percentile(double p)
Computes the specified percentile for this timer.
|
<T> T |
record(Callable<T> rf)
Executes the callable `f` and records the time taken.
|
void |
record(long amount,
TimeUnit unit)
Updates the statistics kept by the counter with the specified amount.
|
void |
record(Runnable rf)
Executes the runnable `f` and records the time taken.
|
long |
totalTime()
The total time in nanoseconds of all recorded events since this timer was created.
|
public static PercentileTimer get(Registry registry, Id id)
registry
- Registry to use.id
- Identifier for the metric being registered.public Id id()
Meter
public Iterable<Measurement> measure()
Meter
public boolean hasExpired()
Meter
hasExpired
in interface Meter
public void record(long amount, TimeUnit unit)
Timer
public <T> T record(Callable<T> rf) throws Exception
Timer
public void record(Runnable rf)
Timer
public double percentile(double p)
p
- Percentile to compute, value must be 0.0 <= p <= 100.0
.p
`th percentile in seconds.public long count()
Timer