| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.metrics2.lib.MetricMutable
org.apache.hadoop.metrics2.lib.MetricMutableStat
public class MetricMutableStat
A mutable metric with stats Useful for keep throughput/latency stats. e.g., new MetricMutableStat("rpcName", "rpcName stats", "ops", "time");
| Field Summary | 
|---|
| Fields inherited from class org.apache.hadoop.metrics2.lib.MetricMutable | 
|---|
| description, name | 
| Constructor Summary | |
|---|---|
| MetricMutableStat(String name,
                  String description,
                  String sampleName,
                  String valueName)Construct a snapshot stat metric with extended stat off by default | |
| MetricMutableStat(String name,
                  String description,
                  String sampleName,
                  String valueName,
                  boolean extended)Construct a sample statistics metric | |
| Method Summary | |
|---|---|
|  void | add(long value)Add a snapshot to the metric | 
|  void | add(long numSamples,
    long sum)Add a number of samples and their sum to the running stat | 
|  void | resetMinMax()Reset the all time min max of the metric | 
|  void | snapshot(MetricsRecordBuilder builder,
         boolean all)Get a snapshot/snapshot of the metric | 
| Methods inherited from class org.apache.hadoop.metrics2.lib.MetricMutable | 
|---|
| changed, clearChanged, setChanged, snapshot | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public MetricMutableStat(String name,
                         String description,
                         String sampleName,
                         String valueName,
                         boolean extended)
name - of the metricdescription - of the metricsampleName - of the metric (e.g. "ops")valueName - of the metric (e.g. "time", "latency")extended - create extended stats (stdev, min/max etc.) by default.
public MetricMutableStat(String name,
                         String description,
                         String sampleName,
                         String valueName)
name - of the metricdescription - of the metricsampleName - of the metric (e.g. "ops")valueName - of the metric (e.g. "time", "latency")| Method Detail | 
|---|
public void add(long numSamples,
                long sum)
numSamples - number of samplessum - of the samplespublic void add(long value)
value - of the metric
public void snapshot(MetricsRecordBuilder builder,
                     boolean all)
MetricMutable
snapshot in class MetricMutablebuilder - the metrics record builderall - if true, snapshot unchanged metrics as wellpublic void resetMinMax()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||