Package org.apache.hadoop.metrics2.lib
Class MutableMetric
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
- Direct Known Subclasses:
MutableCounter,MutableGauge,MutableQuantiles,MutableRates,MutableRatesWithAggregation,MutableRollingAverages,MutableStat
The mutable metric interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchanged()protected voidClear the changed flag in the snapshot operationsprotected voidSet the changed flag in mutable operationsvoidsnapshot(MetricsRecordBuilder builder) Get a snapshot of metric if changedabstract voidsnapshot(MetricsRecordBuilder builder, boolean all) Get a snapshot of the metric
-
Constructor Details
-
MutableMetric
public MutableMetric()
-
-
Method Details
-
snapshot
Get a snapshot of the metric- Parameters:
builder- the metrics record builderall- if true, snapshot unchanged metrics as well
-
snapshot
Get a snapshot of metric if changed- Parameters:
builder- the metrics record builder
-
setChanged
protected void setChanged()Set the changed flag in mutable operations -
clearChanged
protected void clearChanged()Clear the changed flag in the snapshot operations -
changed
public boolean changed()- Returns:
- true if metric is changed since last snapshot
-