public class SimpleTimer extends AbstractTimer
Timer.Builder
Meter.Type
clock, id
Constructor and Description |
---|
SimpleTimer(MeterId id,
Clock clock) |
Modifier and Type | Method and Description |
---|---|
long |
count()
The number of times that record has been called since this timer was created.
|
java.util.List<Measurement> |
measure()
Get the set of measurements for this meter.
|
void |
record(long amount,
java.util.concurrent.TimeUnit unit)
Updates the statistics kept by the counter with the specified amount.
|
double |
totalTime(java.util.concurrent.TimeUnit unit)
The total time of all recorded events since this timer was created.
|
equals, getName, getTags, hashCode, record, record, recordCallable, wrap
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getType, totalTimeNanos, wrap
public void record(long amount, java.util.concurrent.TimeUnit unit)
Timer
amount
- Duration of a single event being measured by this timer. If the amount is less than 0
the value will be dropped.unit
- Time unit for the amount being recorded.public long count()
Timer
public double totalTime(java.util.concurrent.TimeUnit unit)
Timer
public java.util.List<Measurement> measure()
Meter