Class GaugeMetric

java.lang.Object
com.yahoo.container.jdisc.state.MetricValue
com.yahoo.container.jdisc.state.GaugeMetric

public final class GaugeMetric extends MetricValue
A metric which contains a gauge value, i.e a value which represents the magnitude of something measured at a point in time. This metric value contains some additional information about the distribution of this gauge value in the time interval this metric is for.
Author:
Simon Thoresen Hult
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the average reading of this value in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    long
    Returns the number of assignments of this value in the time interval
    double
    Returns the most recent assignment of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    double
    Returns the max value of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    double
    Returns the min value of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    Optional<List<com.yahoo.collections.Tuple2<String,Double>>>
    Returns the 95th percentile value for this time interval
    double
    Returns the sum of all assignments of this metric in the time interval
    newInstance(double last, double max, double min, double sum, long count)
     
    newInstance(double last, double max, double min, double sum, long count, Optional<List<com.yahoo.collections.Tuple2<String,Double>>> percentiles)
     
     
    Create a partial clone of this gauge where the value of 'last' is carried over to the new gauge with all other fields left at defaults (0 for count and sum, biggest possible double for min, smallest possible double for max).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAverage

      public double getAverage()
      Returns the average reading of this value in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    • getLast

      public double getLast()
      Returns the most recent assignment of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    • getMax

      public double getMax()
      Returns the max value of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    • getMin

      public double getMin()
      Returns the min value of this metric in the time interval, or--if no value has been set within this period--the value of 'last' from the most recent interval where this metric was set.
    • getSum

      public double getSum()
      Returns the sum of all assignments of this metric in the time interval
    • getCount

      public long getCount()
      Returns the number of assignments of this value in the time interval
    • getPercentiles

      public Optional<List<com.yahoo.collections.Tuple2<String,Double>>> getPercentiles()
      Returns the 95th percentile value for this time interval
    • newWithPreservedLastValue

      public GaugeMetric newWithPreservedLastValue()
      Create a partial clone of this gauge where the value of 'last' is carried over to the new gauge with all other fields left at defaults (0 for count and sum, biggest possible double for min, smallest possible double for max). Note that since count is 0, these extreme values will never be output from the min/max getters as these will return 'last' in this case.
      Returns:
      A new gauge instance
    • newSingleValue

      public static GaugeMetric newSingleValue(Number val)
    • newInstance

      public static GaugeMetric newInstance(double last, double max, double min, double sum, long count)
    • newInstance

      public static GaugeMetric newInstance(double last, double max, double min, double sum, long count, Optional<List<com.yahoo.collections.Tuple2<String,Double>>> percentiles)