|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.metrics2.util.MetricSampleQuantiles
@InterfaceAudience.Private public class MetricSampleQuantiles
Implementation of the Cormode, Korn, Muthukrishnan, and Srivastava algorithm for streaming calculation of targeted high-percentile epsilon-approximate quantiles. This is a generalization of the earlier work by Greenwald and Khanna (GK), which essentially allows different error bounds on the targeted quantiles, which allows for far more efficient calculation of high-percentiles. See: Cormode, Korn, Muthukrishnan, and Srivastava "Effective Computation of Biased Quantiles over Data Streams" in ICDE 2005 Greenwald and Khanna, "Space-efficient online computation of quantile summaries" in SIGMOD 2001
Constructor Summary | |
---|---|
MetricSampleQuantiles(MetricQuantile[] quantiles)
|
Method Summary | |
---|---|
void |
clear()
Resets the estimator, clearing out all previously inserted items |
long |
getCount()
Returns the number of items that the estimator has processed |
int |
getSampleCount()
Returns the number of samples kept by the estimator |
void |
insert(long v)
Add a new value from the stream. |
Map<MetricQuantile,Long> |
snapshot()
Get a snapshot of the current values of all the tracked quantiles. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetricSampleQuantiles(MetricQuantile[] quantiles)
Method Detail |
---|
public void insert(long v)
v
- public Map<MetricQuantile,Long> snapshot() throws IOException
IOException
- if no items have been added to the estimatorpublic long getCount()
public int getSampleCount()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |