Class MetricsLongValue
- java.lang.Object
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsBase
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsLongValue
-
- Direct Known Subclasses:
MetricsIncLongValue
@LimitedPrivate({"HDFS","MapReduce"}) public class MetricsLongValue extends MetricsBaseThe MetricsLongValue class is for a metric that is not time varied but changes only when it is set. Each time its value is set, it is published only *once* at the next update call.
-
-
Field Summary
-
Fields inherited from class com.mapr.org.apache.hadoop.metrics.util.MetricsBase
NO_DESCRIPTION
-
-
Constructor Summary
Constructors Constructor Description MetricsLongValue(java.lang.String nam, MetricsRegistry registry)Constructor - create a new metricMetricsLongValue(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 longget()Get valuevoidpushMetric(MetricsRecord mr)Push the metric to the mr.voidset(long newValue)Set the value-
Methods inherited from class com.mapr.org.apache.hadoop.metrics.util.MetricsBase
getDescription, getName
-
-
-
-
Constructor Detail
-
MetricsLongValue
public MetricsLongValue(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
-
MetricsLongValue
public MetricsLongValue(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
-
set
public void set(long newValue)
Set the value- Parameters:
newValue-
-
get
public long get()
Get value- Returns:
- the value last set
-
pushMetric
public void pushMetric(MetricsRecord mr)
Push the metric to the mr. The metric is pushed only if it was updated since last push Note this does NOT push to JMX (JMX gets the info viaget()- Specified by:
pushMetricin classMetricsBase- Parameters:
mr-
-
-