|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.netflix.stats.distribution.Distribution
com.netflix.stats.distribution.Histogram
public class Histogram
This extends Distribution by tracking counts of
values per "bucket" and the ability to find the (approximate) median value.
Note that this implements HistogramMBean and so can be registered
as an MBean and accessed via JMX if desired.
| Constructor Summary | |
|---|---|
Histogram(double[] bucketLimits)
Creates a new initially empty Histogram. |
|
Histogram(double min,
double max,
double step)
Creates a new initially empty Histogram with uniformally sized buckets. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears out the distribution, resetting it to its initial state. |
long |
getBucketCount(int i)
Gets the number of values recorded in a bucket. |
long[] |
getBucketCounts()
Gets the number of values recorded in each bucket. |
double |
getBucketMaximum(int i)
Gets the maximum for values recorded in a bucket. |
double[] |
getBucketMaximums()
Gets the maximum bound for the histogram buckets. |
double |
getBucketMinimum(int i)
Gets the minimum for values recorded in a bucket. |
double[] |
getBucketMinimums()
Gets the minimum bound for the histogram buckets. |
double |
getMedian()
Gets the approximate median value, that is the value where half of the observed values are less than the median and half are greater. |
int |
getNumBuckets()
Gets the total number of buckets. |
double |
getPercentile(int percent)
Gets the (approximate) percentile value, that is the value where some desired percent of the observed values are less than the percentile value and the remainder are greater. |
long |
getPercentileRank(double value)
Gets the (approximate) percentage of observed values that are less than a given value. |
void |
noteValue(double val)
Adds a value to the collected data. |
| Methods inherited from class com.netflix.stats.distribution.Distribution |
|---|
add, getMaximum, getMean, getMinimum, getNumValues, getStdDev, getVariance, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.netflix.stats.distribution.DistributionMBean |
|---|
getMaximum, getMean, getMinimum, getNumValues, getStdDev, getVariance |
| Constructor Detail |
|---|
public Histogram(double[] bucketLimits)
bucketLimits - an array of max values for each bucket;
the values must be sorted in increasing order.
The first bucket records values in the range
(-infinity .. bucketLimits[0]),
the last bucket records values in the range
(bucketLimits[bucketLimits.length-1] .. +infinity)
public Histogram(double min,
double max,
double step)
min - the upper limit for the first bucketmax - the upper limit for the final bucket
(excluding the catch-all bucket)step - the size of the range of each bucket| Method Detail |
|---|
public void noteValue(double val)
noteValue in interface DataCollectornoteValue in class Distributionpublic void clear()
clear in interface DistributionMBeanclear in class Distributionpublic int getNumBuckets()
getNumBuckets in interface HistogramMBeanpublic long getBucketCount(int i)
public double getBucketMinimum(int i)
public double getBucketMaximum(int i)
public long[] getBucketCounts()
getBucketCounts in interface HistogramMBeanpublic double[] getBucketMinimums()
getBucketMinimums in interface HistogramMBeanpublic double[] getBucketMaximums()
getBucketMaximums in interface HistogramMBeanpublic double getMedian()
getMedian in interface HistogramMBeanpublic double getPercentile(int percent)
getPercentile in interface HistogramMBeanpublic long getPercentileRank(double value)
getPercentileRank in interface HistogramMBean
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||