org.apache.hadoop.metrics2.lib
Class MutableRates

java.lang.Object
  extended by org.apache.hadoop.metrics2.lib.MutableMetric
      extended by org.apache.hadoop.metrics2.lib.MutableRates

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class MutableRates
extends MutableMetric

Helper class to manage a group of mutable rate metrics


Method Summary
 void add(String name, long elapsed)
          Add a rate sample for a rate metric
 void init(Class<?> protocol)
          Initialize the registry with all the methods in a protocol so they all show up in the first snapshot.
 void snapshot(MetricsRecordBuilder rb, boolean all)
          Get a snapshot of the metric
 
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
 

Method Detail

init

public void init(Class<?> protocol)
Initialize the registry with all the methods in a protocol so they all show up in the first snapshot. Convenient for JMX implementations.

Parameters:
protocol - the protocol class

add

public void add(String name,
                long elapsed)
Add a rate sample for a rate metric

Parameters:
name - of the rate metric
elapsed - time

snapshot

public void snapshot(MetricsRecordBuilder rb,
                     boolean all)
Description copied from class: MutableMetric
Get a snapshot of the metric

Specified by:
snapshot in class MutableMetric
Parameters:
rb - the metrics record builder
all - if true, snapshot unchanged metrics as well


Copyright © 2014 Apache Software Foundation. All Rights Reserved.