## org.apache.hadoop.metrics.util
Class MetricsTimeVaryingLong

    java.lang.Object
      org.apache.hadoop.metrics.util.MetricsBase
          org.apache.hadoop.metrics.util.MetricsTimeVaryingLong

Deprecated. in favor of `MetricMutableCounterLong`.

    @Deprecated
    @InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"})
    public class MetricsTimeVaryingLong

extends MetricsBase

The MetricsTimeVaryingLong class is for a metric that naturally varies over time (e.g. number of files created). The metrics is accumulated over an interval (set in the metrics config file); the metrics is published at the end of each interval and then reset to zero. Hence the counter has the value in the current interval. Note if one wants a time associated with the metric then use

See Also:
  `MetricsTimeVaryingRate`

Field Summary

Fields inherited from class org.apache.hadoop.metrics.util.MetricsBase
`NO_DESCRIPTION`

Constructor Summary
`MetricsTimeVaryingLong(String nam, MetricsRegistry registry)` Deprecated. Constructor - create a new metric
`MetricsTimeVaryingLong(String nam, MetricsRegistry registry, String description)` Deprecated. Constructor - create a new metric

Method Summary
`long` `getCurrentIntervalValue()` Deprecated. The Value at the current interval
`long` `getPreviousIntervalValue()` Deprecated. The Value at the Previous interval
`void` `inc()` Deprecated. Inc metrics by one
`void` `inc(long incr)` Deprecated. Inc metrics for incr vlaue
`void` `pushMetric(MetricsRecord mr)` Deprecated. Push the delta metrics to the mr.

Methods inherited from class org.apache.hadoop.metrics.util.MetricsBase
`getDescription, getName`

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

Constructor Detail

### MetricsTimeVaryingLong

    public MetricsTimeVaryingLong(String nam,
                                  MetricsRegistry registry,
                                  String description)

  Deprecated.
  Constructor - create a new metric

  Parameters:
    `nam` - the name of the metrics to be used to publish the metric
    `registry` - - where the metrics object will be registered

### MetricsTimeVaryingLong

    public MetricsTimeVaryingLong(String nam,
                                  MetricsRegistry registry)

  Deprecated.
  Constructor - create a new metric

  Parameters:
    `nam` - the name of the metrics to be used to publish the metric
    `registry` - - where the metrics object will be registered A description of `MetricsBase.NO_DESCRIPTION` is used

Method Detail

### inc

    public void inc(long incr)

  Deprecated.
  Inc metrics for incr vlaue

  Parameters:
    `incr` - - number of operations

### inc

    public void inc()

  Deprecated.
  Inc metrics by one

### pushMetric

    public void pushMetric(MetricsRecord mr)

  Deprecated.
  Push the delta metrics to the mr. The delta is since the last push/interval. Note this does NOT push to JMX (JMX gets the info via `previousIntervalValue`

  Specified by:
    `pushMetric` in class `MetricsBase`
  Parameters:
    `mr` -

### getPreviousIntervalValue

    public long getPreviousIntervalValue()

  Deprecated.
  The Value at the Previous interval

  Returns:
    prev interval value

### getCurrentIntervalValue

    public long getCurrentIntervalValue()

  Deprecated.
  The Value at the current interval

  Returns:
    prev interval value

Copyright © 2009 The Apache Software Foundation