org.apache.hadoop.metrics2.lib
Class MetricMutableQuantiles

java.lang.Object
  extended by org.apache.hadoop.metrics2.lib.MutableMetric
      extended by org.apache.hadoop.metrics2.lib.MetricMutableQuantiles
All Implemented Interfaces:
MetricHistogram

@InterfaceAudience.Private
public class MetricMutableQuantiles
extends org.apache.hadoop.metrics2.lib.MutableMetric
implements MetricHistogram

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.


Field Summary
protected  Map<MetricQuantile,Long> previousSnapshot
           
 
Fields inherited from interface org.apache.hadoop.metrics2.MetricHistogram
MAX_METRIC_NAME, MEAN_METRIC_NAME, MEDIAN_METRIC_NAME, MIN_METRIC_NAME, NINETY_FIFTH_PERCENTILE_METRIC_NAME, NINETY_NINETH_PERCENTILE_METRIC_NAME, NUM_OPS_METRIC_NAME, SEVENTY_FIFTH_PERCENTILE_METRIC_NAME
 
Constructor Summary
MetricMutableQuantiles(String name, String description, String sampleName, String valueName, int interval)
          Instantiates a new MetricMutableQuantiles for a metric that rolls itself over on the specified time interval.
 
Method Summary
 void add(long value)
          Add a single value to a histogram's stream of values.
 int getInterval()
           
 void snapshot(org.apache.hadoop.metrics2.MetricsRecordBuilder builder, boolean all)
           
 
Methods inherited from class org.apache.hadoop.metrics2.lib.MutableMetric
changed, clearChanged, setChanged, snapshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousSnapshot

protected Map<MetricQuantile,Long> previousSnapshot
Constructor Detail

MetricMutableQuantiles

public MetricMutableQuantiles(String name,
                              String description,
                              String sampleName,
                              String valueName,
                              int interval)
Instantiates a new MetricMutableQuantiles for a metric that rolls itself over on the specified time interval.

Parameters:
name - of the metric
description - long-form textual description of the metric
sampleName - type of items in the stream (e.g., "Ops")
valueName - type of the values
interval - rollover interval (in seconds) of the estimator
Method Detail

snapshot

public void snapshot(org.apache.hadoop.metrics2.MetricsRecordBuilder builder,
                     boolean all)
Specified by:
snapshot in class org.apache.hadoop.metrics2.lib.MutableMetric

add

public void add(long value)
Description copied from interface: MetricHistogram
Add a single value to a histogram's stream of values.

Specified by:
add in interface MetricHistogram

getInterval

public int getInterval()


Copyright © 2015 The Apache Software Foundation. All rights reserved.