com.espertech.esper.metrics.codahale_metrics.metrics.core
Class Histogram

java.lang.Object
  extended by com.espertech.esper.metrics.codahale_metrics.metrics.core.Histogram
All Implemented Interfaces:
Metric, Sampling, Summarizable

public class Histogram
extends java.lang.Object
implements Metric, Sampling, Summarizable

A metric which calculates the distribution of a value.

See Also:
Accurately computing running variance

Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clear

public void clear()
Clears all recorded values.


update

public void update(int value)
Adds a recorded value.

Parameters:
value - the length of the value

update

public void update(long value)
Adds a recorded value.

Parameters:
value - the length of the value

count

public long count()
Returns the number of values recorded.

Returns:
the number of values recorded

max

public double max()
Description copied from interface: Summarizable
Returns the largest recorded value.

Specified by:
max in interface Summarizable
Returns:
the largest recorded value

min

public double min()
Description copied from interface: Summarizable
Returns the smallest recorded value.

Specified by:
min in interface Summarizable
Returns:
the smallest recorded value

mean

public double mean()
Description copied from interface: Summarizable
Returns the arithmetic mean of all recorded values.

Specified by:
mean in interface Summarizable
Returns:
the arithmetic mean of all recorded values

stdDev

public double stdDev()
Description copied from interface: Summarizable
Returns the standard deviation of all recorded values.

Specified by:
stdDev in interface Summarizable
Returns:
the standard deviation of all recorded values

sum

public double sum()
Description copied from interface: Summarizable
Returns the sum of all recorded values.

Specified by:
sum in interface Summarizable
Returns:
the sum of all recorded values

getSnapshot

public Snapshot getSnapshot()
Description copied from interface: Sampling
Returns a snapshot of the values.

Specified by:
getSnapshot in interface Sampling
Returns:
a snapshot of the values

processWith

public <T> void processWith(MetricProcessor<T> processor,
                            MetricName name,
                            T context)
                 throws java.lang.Exception
Description copied from interface: Metric
Allow the given MetricProcessor to process this as a metric.

Specified by:
processWith in interface Metric
Type Parameters:
T - the type of the context object
Parameters:
processor - a MetricProcessor
name - the name of the current metric
context - a given context which should be passed on to processor
Throws:
java.lang.Exception - if something goes wrong

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com