public class Histogram extends Object implements Metric, Sampling, Summarizable
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all recorded values.
|
long |
count()
Returns the number of values recorded.
|
Snapshot |
getSnapshot()
Returns a snapshot of the values.
|
double |
max()
Returns the largest recorded value.
|
double |
mean()
Returns the arithmetic mean of all recorded values.
|
double |
min()
Returns the smallest recorded value.
|
<T> void |
processWith(MetricProcessor<T> processor,
MetricName name,
T context)
Allow the given
MetricProcessor to process this as a metric. |
double |
stdDev()
Returns the standard deviation of all recorded values.
|
double |
sum()
Returns the sum of all recorded values.
|
void |
update(int value)
Adds a recorded value.
|
void |
update(long value)
Adds a recorded value.
|
public void clear()
public void update(int value)
value
- the length of the valuepublic void update(long value)
value
- the length of the valuepublic long count()
public double max()
Summarizable
max
in interface Summarizable
public double min()
Summarizable
min
in interface Summarizable
public double mean()
Summarizable
mean
in interface Summarizable
public double stdDev()
Summarizable
stdDev
in interface Summarizable
public double sum()
Summarizable
sum
in interface Summarizable
public Snapshot getSnapshot()
Sampling
getSnapshot
in interface Sampling
public <T> void processWith(MetricProcessor<T> processor, MetricName name, T context) throws 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
Exception
- if something goes wrongCopyright © 2014. All Rights Reserved.