Class MetricsIntValue

  • Direct Known Subclasses:
    MetricsIncIntValue

    @LimitedPrivate({"HDFS","MapReduce"})
    public class MetricsIntValue
    extends MetricsBase
    The MetricsIntValue 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.
    • Constructor Detail

      • MetricsIntValue

        public MetricsIntValue​(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 metric
        registry - - where the metrics object will be registered
      • MetricsIntValue

        public MetricsIntValue​(java.lang.String nam,
                               MetricsRegistry registry)
        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

      • set

        public void set​(int newValue)
        Set the value
        Parameters:
        newValue -
      • get

        public int 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 via get()
        Specified by:
        pushMetric in class MetricsBase
        Parameters:
        mr -