类 RichGauge


  • public final class RichGauge
    extends Object
    A gauge which stores the maximum, minimum and average in addition to the current value.

    The value of the average will depend on whether a weight ('alpha') is set for the gauge. If it is unset, the average will contain a simple arithmetic mean. If a weight is set, an exponential moving average will be calculated as defined in this NIST document.

    • 构造器详细资料

      • RichGauge

        public RichGauge​(String name)
        Creates an "empty" gauge. The average, max and min will be zero, but this initial value will not be included after the first value has been set on the gauge.
        参数:
        name - the name under which the gauge will be stored.
      • RichGauge

        public RichGauge​(String name,
                         double value,
                         double alpha,
                         double mean,
                         double max,
                         double min,
                         long count)
    • 方法详细资料

      • getName

        public String getName()
        Return the name of the gauge.
        返回:
        the name
      • getValue

        public double getValue()
        Return the current value of the gauge.
        返回:
        the value
      • getAverage

        public double getAverage()
        Return either an exponential weighted moving average or a simple mean, respectively, depending on whether the weight 'alpha' has been set for this gauge.
        返回:
        The average over all the accumulated values
      • getMax

        public double getMax()
        Return the maximum value of the gauge.
        返回:
        the maximum value
      • getMin

        public double getMin()
        Return the minimum value of the gauge.
        返回:
        the minimum value
      • getCount

        public long getCount()
        Return the number of times the value has been set.
        返回:
        the value set count
      • getAlpha

        public double getAlpha()
        Return the smoothing constant value.
        返回:
        the alpha smoothing value