|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esper.metrics.codahale_metrics.metrics.core.Timer
public class Timer
A timer metric which aggregates timing durations and provides duration statistics, plus
throughput statistics via Meter
.
Method Summary | ||
---|---|---|
void |
clear()
Clears all recorded durations. |
|
long |
count()
Returns the number of events which have been marked. |
|
java.util.concurrent.TimeUnit |
durationUnit()
Returns the timer's duration scale unit. |
|
java.lang.String |
eventType()
Returns the type of events the meter is measuring. |
|
double |
fifteenMinuteRate()
Returns the fifteen-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. |
|
double |
fiveMinuteRate()
Returns the five-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. |
|
Snapshot |
getSnapshot()
Returns a snapshot of the values. |
|
double |
max()
Returns the longest recorded duration. |
|
double |
mean()
Returns the arithmetic mean of all recorded durations. |
|
double |
meanRate()
Returns the mean rate at which events have occurred since the meter was created. |
|
double |
min()
Returns the shortest recorded duration. |
|
double |
oneMinuteRate()
Returns the one-minute exponentially-weighted moving average rate at which events have occurred since the meter was created. |
|
|
processWith(MetricProcessor<T> processor,
MetricName name,
T context)
Allow the given MetricProcessor to process this as a metric. |
|
java.util.concurrent.TimeUnit |
rateUnit()
Returns the meter's rate unit. |
|
double |
stdDev()
Returns the standard deviation of all recorded durations. |
|
void |
stop()
Stop the instance. |
|
double |
sum()
Returns the sum of all recorded durations. |
|
TimerContext |
time()
Returns a timing TimerContext , which measures an elapsed time in nanoseconds. |
|
|
time(java.util.concurrent.Callable<T> event)
Times and records the duration of event. |
|
void |
update(long duration,
java.util.concurrent.TimeUnit unit)
Adds a recorded duration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.util.concurrent.TimeUnit durationUnit()
public java.util.concurrent.TimeUnit rateUnit()
Metered
rateUnit
in interface Metered
public void clear()
public void update(long duration, java.util.concurrent.TimeUnit unit)
duration
- the length of the durationunit
- the scale unit of duration
public <T> T time(java.util.concurrent.Callable<T> event) throws java.lang.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
java.lang.Exception
- if event
throws an Exception
public TimerContext time()
TimerContext
, which measures an elapsed time in nanoseconds.
TimerContext
public long count()
Metered
count
in interface Metered
public double fifteenMinuteRate()
Metered
top
Unix command.
fifteenMinuteRate
in interface Metered
public double fiveMinuteRate()
Metered
top
Unix command.
fiveMinuteRate
in interface Metered
public double meanRate()
Metered
meanRate
in interface Metered
public double oneMinuteRate()
Metered
top
Unix command.
oneMinuteRate
in interface Metered
public double max()
max
in interface Summarizable
public double min()
min
in interface Summarizable
public double mean()
mean
in interface Summarizable
public double stdDev()
stdDev
in interface Summarizable
public double sum()
sum
in interface Summarizable
public Snapshot getSnapshot()
Sampling
getSnapshot
in interface Sampling
public java.lang.String eventType()
Metered
eventType
in interface Metered
public void stop()
Stoppable
stop
in interface Stoppable
public <T> void processWith(MetricProcessor<T> processor, MetricName name, T context) throws java.lang.Exception
Metric
MetricProcessor
to process this
as a metric.
processWith
in interface Metric
T
- the type of the context objectprocessor
- a MetricProcessor
name
- the name of the current metriccontext
- a given context which should be passed on to processor
java.lang.Exception
- if something goes wrong
|
© 2006-2014 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |