## org.apache.hadoop.metrics2.lib
Class MetricMutableCounterLong

    java.lang.Object
      org.apache.hadoop.metrics2.lib.MetricMutable
          org.apache.hadoop.metrics2.lib.MetricMutableCounter<Long>
              org.apache.hadoop.metrics2.lib.MetricMutableCounterLong

    public class MetricMutableCounterLong

extends MetricMutableCounter<Long>

A mutable long counter

Field Summary

Fields inherited from class org.apache.hadoop.metrics2.lib.MetricMutable
`description, name`

Constructor Summary
`MetricMutableCounterLong(String name, String description, long initValue)` Construct a mutable long counter

Method Summary
`void` `incr()` Increment the metric value by 1.
`void` `incr(long delta)` Increment the value by a delta
`void` `snapshot(MetricsRecordBuilder builder, boolean all)` Get a snapshot/snapshot of the metric

Methods inherited from class org.apache.hadoop.metrics2.lib.MetricMutable
`changed, clearChanged, setChanged, snapshot`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MetricMutableCounterLong

    public MetricMutableCounterLong(String name,
                                    String description,
                                    long initValue)

  Construct a mutable long counter

  Parameters:
    `name` - of the counter
    `description` - of the counter
    `initValue` - the initial value of the counter

Method Detail

### incr

    public void incr()

  Description copied from class: `MetricMutableCounter`
  Increment the metric value by 1.

  Specified by:
    `incr` in class `MetricMutableCounter<Long>`

### incr

    public void incr(long delta)

  Increment the value by a delta

  Parameters:
    `delta` - of the increment

### snapshot

    public void snapshot(MetricsRecordBuilder builder,
                         boolean all)

  Description copied from class: `MetricMutable`
  Get a snapshot/snapshot of the metric

  Specified by:
    `snapshot` in class `MetricMutable`
  Parameters:
    `builder` - the metrics record builder
    `all` - if true, snapshot unchanged metrics as well

Copyright © 2009 The Apache Software Foundation