|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yammer.metrics.core.TimerMetric
public class TimerMetric
A timer metric which aggregates timing durations and provides duration statistics, plus
throughput statistics via MeterMetric.
| Constructor Summary | |
|---|---|
TimerMetric(ScheduledExecutorService tickThread,
TimeUnit durationUnit,
TimeUnit rateUnit)
Creates a new TimerMetric. |
|
TimerMetric(ScheduledExecutorService tickThread,
TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
Creates a new TimerMetric. |
|
TimerMetric(TimeUnit durationUnit,
TimeUnit rateUnit)
Deprecated. either use the other constructor or create via the MetricsRegistry or
Metrics |
|
TimerMetric(TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
Deprecated. either use the other constructor or create via the MetricsRegistry or
Metrics |
|
| Method Summary | ||
|---|---|---|
void |
clear()
Clears all recorded durations. |
|
long |
count()
Returns the number of events which have been marked. |
|
void |
dump(File output)
Writes the values of the timer's sample to the given file. |
|
TimeUnit |
durationUnit()
Returns the timer's duration scale unit. |
|
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. |
|
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. |
|
double |
percentile(double percentile)
Returns the duration at the given percentile. |
|
Double[] |
percentiles(Double... percentiles)
Returns an array of durations at the given percentiles. |
|
|
processWith(MetricsProcessor<T> processor,
MetricName name,
T context)
|
|
TimeUnit |
rateUnit()
Returns the meter's rate unit. |
|
double |
stdDev()
Returns the standard deviation of all recorded durations. |
|
void |
stop()
|
|
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. |
|
List<Double> |
values()
Returns a list of all recorded durations in the timer's sample. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimerMetric(TimeUnit durationUnit,
TimeUnit rateUnit)
MetricsRegistry or
Metrics
TimerMetric.
durationUnit - the scale unit for this timer's duration metricsrateUnit - the scale unit for this timer's rate metrics
public TimerMetric(TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
MetricsRegistry or
Metrics
TimerMetric with the specified clock.
durationUnit - the scale unit for this timer's duration metricsrateUnit - the scale unit for this timer's rate metricsclock - the clock used to calculate duration
public TimerMetric(ScheduledExecutorService tickThread,
TimeUnit durationUnit,
TimeUnit rateUnit)
TimerMetric.
tickThread - background thread for updating the ratesdurationUnit - the scale unit for this timer's duration metricsrateUnit - the scale unit for this timer's rate metrics
public TimerMetric(ScheduledExecutorService tickThread,
TimeUnit durationUnit,
TimeUnit rateUnit,
Clock clock)
TimerMetric.
tickThread - background thread for updating the ratesdurationUnit - the scale unit for this timer's duration metricsrateUnit - the scale unit for this timer's rate metricsclock - the clock used to calculate duration| Method Detail |
|---|
public TimeUnit durationUnit()
public TimeUnit rateUnit()
Metered
rateUnit in interface Meteredpublic 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 eventevent - a Callable whose Callable.call() method implements a process
whose duration should be timed
event
Exception - if event throws an Exceptionpublic TimerContext time()
TimerContext, which measures an elapsed time in nanoseconds.
TimerContextpublic long count()
Metered
count in interface Meteredpublic double fifteenMinuteRate()
Meteredtop Unix command.
fifteenMinuteRate in interface Meteredpublic double fiveMinuteRate()
Meteredtop Unix command.
fiveMinuteRate in interface Meteredpublic double meanRate()
Metered
meanRate in interface Meteredpublic double oneMinuteRate()
Meteredtop Unix command.
oneMinuteRate in interface Meteredpublic double max()
max in interface Summarizedpublic double min()
min in interface Summarizedpublic double mean()
mean in interface Summarizedpublic double stdDev()
stdDev in interface Summarizedpublic double percentile(double percentile)
Percentiled
percentile in interface Percentiledpercentile - a percentile (0..1)
public Double[] percentiles(Double... percentiles)
Percentiled
percentiles in interface Percentiledpercentiles - one or more percentiles (0..1)
public String eventType()
Metered
eventType in interface Meteredpublic List<Double> values()
public void dump(File output)
throws IOException
output - the file to which the values will be written
IOException - if there is an error writing the valuespublic void stop()
stop in interface Stoppable
public <T> void processWith(MetricsProcessor<T> processor,
MetricName name,
T context)
throws Exception
processWith in interface MetricException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||