org.apache.solr.util.stats
Constructor and Description |
---|
Timer() |
Timer(TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
Creates a new
Timer . |
Modifier and Type | Method and Description |
---|---|
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. |
<T> T |
time(Callable<T> event)
Times and records the duration of event.
|
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration.
|
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 timedevent
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()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.