|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.util.stats.Timer
public class Timer
A timer metric which aggregates timing durations and provides duration statistics, plus
throughput statistics via Meter
.
Constructor Summary | |
---|---|
Timer()
|
|
Timer(TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
Creates a new Timer . |
Method Summary | ||
---|---|---|
void |
clear()
Clears all recorded durations. |
|
long |
getCount()
|
|
TimeUnit |
getDurationUnit()
Returns the timer's duration scale unit. |
|
String |
getEventType()
|
|
double |
getFifteenMinuteRate()
|
|
double |
getFiveMinuteRate()
|
|
double |
getMax()
Returns the longest recorded duration. |
|
double |
getMean()
Returns the arithmetic mean of all recorded durations. |
|
double |
getMeanRate()
|
|
double |
getMin()
Returns the shortest recorded duration. |
|
double |
getOneMinuteRate()
|
|
TimeUnit |
getRateUnit()
|
|
Snapshot |
getSnapshot()
|
|
double |
getStdDev()
Returns the standard deviation of all recorded durations. |
|
double |
getSum()
Returns the sum of all recorded durations. |
|
TimerContext |
time()
Returns a timing TimerContext , which measures an elapsed time in nanoseconds. |
|
|
time(Callable<T> event)
Times and records the duration of event. |
|
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer()
public Timer(TimeUnit durationUnit, TimeUnit rateUnit, Clock clock)
Timer
.
durationUnit
- the scale unit for this timer's duration metricsrateUnit
- the scale unit for this timer's rate metricsclock
- the clock used to calculate durationMethod Detail |
---|
public TimeUnit getDurationUnit()
public TimeUnit getRateUnit()
public void clear()
public void update(long duration, TimeUnit unit)
duration
- the length of the durationunit
- the scale unit of duration
public <T> T time(Callable<T> event) throws Exception
T
- the type of the value returned by event
event
- a Callable
whose Callable.call()
method implements a process
whose duration should be timed
event
Exception
- if event
throws an Exception
public TimerContext time()
TimerContext
, which measures an elapsed time in nanoseconds.
TimerContext
public long getCount()
public double getFifteenMinuteRate()
public double getFiveMinuteRate()
public double getMeanRate()
public double getOneMinuteRate()
public double getMax()
public double getMin()
public double getMean()
public double getStdDev()
public double getSum()
public Snapshot getSnapshot()
public String getEventType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |