Package org.apache.hadoop.metrics2.lib
Class MutableRates
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
org.apache.hadoop.metrics2.lib.MutableRates
Helper class to manage a group of mutable rate metrics
This class synchronizes all accesses to the metrics it
contains, so it should not be used in situations where
there is high contention on the metrics.
MutableRatesWithAggregation is preferable in that
situation.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a rate sample for a rate metricvoidInitialize the registry with all the methods in a protocol so they all show up in the first snapshot.voidsnapshot(MetricsRecordBuilder rb, boolean all) Get a snapshot of the metricMethods inherited from class org.apache.hadoop.metrics2.lib.MutableMetric
changed, clearChanged, setChanged, snapshot
-
Method Details
-
init
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
Add a rate sample for a rate metric- Parameters:
name- of the rate metricelapsed- time
-
snapshot
Description copied from class:MutableMetricGet a snapshot of the metric- Specified by:
snapshotin classMutableMetric- Parameters:
rb- the metrics record builderall- if true, snapshot unchanged metrics as well
-