Class MetricsTimeVaryingLong
- java.lang.Object
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsBase
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsTimeVaryingLong
-
@LimitedPrivate({"HDFS","MapReduce"}) public class MetricsTimeVaryingLong extends MetricsBaseThe 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:
org.apache.hadoop.metrics.util.MetricsTimeVaryingRate
-
-
Field Summary
-
Fields inherited from class com.mapr.org.apache.hadoop.metrics.util.MetricsBase
NO_DESCRIPTION
-
-
Constructor Summary
Constructors Constructor Description MetricsTimeVaryingLong(java.lang.String nam, MetricsRegistry registry)Constructor - create a new metricMetricsTimeVaryingLong(java.lang.String nam, MetricsRegistry registry, java.lang.String description)Constructor - create a new metric
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCurrentIntervalValue()The Value at the current intervallonggetPreviousIntervalValue()The Value at the Previous intervalvoidinc()Inc metrics by onevoidinc(long incr)Inc metrics for incr vlauevoidpushMetric(MetricsRecord mr)Push the delta metrics to the mr.-
Methods inherited from class com.mapr.org.apache.hadoop.metrics.util.MetricsBase
getDescription, getName
-
-
-
-
Constructor Detail
-
MetricsTimeVaryingLong
public MetricsTimeVaryingLong(java.lang.String nam, MetricsRegistry registry, java.lang.String description)Constructor - create a new metric- Parameters:
nam- the name of the metrics to be used to publish the metricregistry- - where the metrics object will be registered
-
MetricsTimeVaryingLong
public MetricsTimeVaryingLong(java.lang.String nam, MetricsRegistry registry)Constructor - create a new metric- Parameters:
nam- the name of the metrics to be used to publish the metricregistry- - where the metrics object will be registered A description ofMetricsBase.NO_DESCRIPTIONis used
-
-
Method Detail
-
inc
public void inc(long 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 viapreviousIntervalValue- Specified by:
pushMetricin classMetricsBase- Parameters:
mr-
-
getPreviousIntervalValue
public long getPreviousIntervalValue()
The Value at the Previous interval- Returns:
- prev interval value
-
getCurrentIntervalValue
public long getCurrentIntervalValue()
The Value at the current interval- Returns:
- prev interval value
-
-