Package org.apache.hadoop.metrics2.lib
Class MutableGaugeLong
java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetric
org.apache.hadoop.metrics2.lib.MutableGauge
org.apache.hadoop.metrics2.lib.MutableGaugeLong
A mutable long gauge
-
Method Summary
Modifier and TypeMethodDescriptionvoiddecr()Decrement the value of the metric by 1voiddecr(long delta) decrement by deltavoidincr()Increment the value of the metric by 1voidincr(long delta) Increment by deltavoidset(long value) Set the value of the metricvoidsnapshot(MetricsRecordBuilder builder, boolean all) Get a snapshot of the metrictoString()longvalue()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 long 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(long 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(long delta) decrement by delta- Parameters:
delta- of the decrement
-
set
public void set(long 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
-