Package org.apache.hadoop.metrics2.lib
Class MutableGaugeInt
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
org.apache.hadoop.metrics2.lib.MutableGauge
org.apache.hadoop.metrics2.lib.MutableGaugeInt
A mutable int gauge
-
Method Summary
Modifier and TypeMethodDescriptionvoiddecr()Decrement the value of the metric by 1voiddecr(int delta) decrement by deltavoidincr()Increment the value of the metric by 1voidincr(int delta) Increment by deltavoidset(int value) Set the value of the metricvoidsnapshot(MetricsRecordBuilder builder, boolean all) Get a snapshot of the metrictoString()intvalue()Methods inherited from class org.apache.hadoop.metrics2.lib.MutableGauge
infoMethods inherited from class org.apache.hadoop.metrics2.lib.MutableMetric
changed, clearChanged, setChanged, snapshot
-
Method Details
-
value
public int value() -
incr
public void incr()Description copied from class:MutableGaugeIncrement the value of the metric by 1- Specified by:
incrin classMutableGauge
-
incr
public void incr(int delta) Increment by delta- Parameters:
delta- of the increment
-
decr
public void decr()Description copied from class:MutableGaugeDecrement the value of the metric by 1- Specified by:
decrin classMutableGauge
-
decr
public void decr(int delta) decrement by delta- Parameters:
delta- of the decrement
-
set
public void set(int value) Set the value of the metric- Parameters:
value- to set
-
snapshot
Description copied from class:MutableMetricGet a snapshot of the metric- Specified by:
snapshotin classMutableMetric- Parameters:
builder- the metrics record builderall- if true, snapshot unchanged metrics as well
-
toString
-