public class SimpleTimer extends AbstractTimer
Timer.Builder
Meter.Type
clock
Constructor and Description |
---|
SimpleTimer(java.lang.String name,
java.lang.Iterable<Tag> tags,
java.lang.String description,
Clock clock) |
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.
|
double |
totalTime(java.util.concurrent.TimeUnit unit)
The total time of all recorded events since this timer was created.
|
equals, hashCode, record, record, recordCallable, wrap
getDescription, getName, getTags
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getType, measure, totalTimeNanos, wrap
getDescription, getName, getTags
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