org.apache.hadoop.metrics.util
Class MetricsTimeVaryingInt

java.lang.Object
  extended by org.apache.hadoop.metrics.util.MetricsTimeVaryingInt

public class MetricsTimeVaryingInt
extends Object

The MetricsTimeVaryingInt class is for a metric that naturally varies over time (e.g. number of files created). The metric is is published at interval heart beat (the interval is set in the metrics config file). Note if one wants a time associated with the metric then use

See Also:
MetricsTimeVaryingRate

Constructor Summary
MetricsTimeVaryingInt(String nam)
          Constructor - create a new metric
 
Method Summary
 int getPreviousIntervalValue()
          The Value at the Previous interval
 void inc()
          Inc metrics by one
 void inc(int incr)
          Inc metrics for incr vlaue
 void pushMetric(MetricsRecord mr)
          Push the delta metrics to the mr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricsTimeVaryingInt

public MetricsTimeVaryingInt(String nam)
Constructor - create a new metric

Parameters:
nam - the name of the metrics to be used to publish the metric
Method Detail

inc

public void inc(int incr)
Inc metrics for incr vlaue

Parameters:
incr - - number of operations

inc

public void inc()
Inc metrics by one


pushMetric

public void pushMetric(MetricsRecord mr)
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

Parameters:
mr -

getPreviousIntervalValue

public int getPreviousIntervalValue()
The Value at the Previous interval

Returns:
prev interval value


Copyright © 2008 The Apache Software Foundation