org.apache.hadoop.metrics2.lib
Class MutableQuantiles
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
org.apache.hadoop.metrics2.lib.MutableQuantiles
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class MutableQuantiles
- extends MutableMetric
Watches a stream of long values, maintaining online estimates of specific
quantiles with provably low error bounds. This is particularly useful for
accurate high-percentile (e.g. 95th, 99th) latency metrics.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
quantiles
public static final org.apache.hadoop.metrics2.util.Quantile[] quantiles
previousSnapshot
protected Map<org.apache.hadoop.metrics2.util.Quantile,Long> previousSnapshot
MutableQuantiles
public MutableQuantiles(String name,
String description,
String sampleName,
String valueName,
int interval)
- Instantiates a new
MutableQuantiles
for a metric that rolls itself
over on the specified time interval.
- Parameters:
name
- of the metricdescription
- long-form textual description of the metricsampleName
- type of items in the stream (e.g., "Ops")valueName
- type of the valuesinterval
- rollover interval (in seconds) of the estimator
snapshot
public void snapshot(MetricsRecordBuilder builder,
boolean all)
- Description copied from class:
MutableMetric
- Get a snapshot of the metric
- Specified by:
snapshot
in class MutableMetric
- Parameters:
builder
- the metrics record builderall
- if true, snapshot unchanged metrics as well
add
public void add(long value)
getInterval
public int getInterval()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.