MutableGaugeInt (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2.lib, class: MutableGaugeInt

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

@Public @Evolving public class MutableGaugeInt extends MutableGauge
A mutable int gauge

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `decr()`
  Decrement the value of the metric by 1
  `void`
  `decr(int delta)`
  decrement by delta
  `void`
  `incr()`
  Increment the value of the metric by 1
  `void`
  `incr(int delta)`
  Increment by delta
  `void`
  `set(int value)`
  Set the value of the metric
  `void`
  `snapshot(MetricsRecordBuilder builder, boolean all)`
  Get a snapshot of the metric
  `String`
  `toString()`
  `int`
  `value()`

  ### Methods inherited from class org.apache.hadoop.metrics2.lib.MutableGauge

  `info`

  ### 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, wait, wait, wait`

- ## Method Details

  - ### value

    public int value()

  - ### incr

    public void incr()
    Description copied from class: `MutableGauge`
    Increment the value of the metric by 1
    Specified by:
      `incr` in class `MutableGauge`

  - ### incr

    public void incr(int delta)
    Increment by delta
    Parameters:
      `delta` - of the increment

  - ### decr

    public void decr()
    Description copied from class: `MutableGauge`
    Decrement the value of the metric by 1
    Specified by:
      `decr` in class `MutableGauge`

  - ### 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

    public void snapshot(MetricsRecordBuilder builder, boolean all)
    Description copied from class: `MutableMetric`
    Get a snapshot of the metric
    Specified by:
      `snapshot` in class `MutableMetric`
    Parameters:
      `builder` - the metrics record builder
      `all` - if true, snapshot unchanged metrics as well

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`
    Returns:
      the value of the metric