Package com.yahoo.container.jdisc.state
Class GaugeMetric
java.lang.Object
com.yahoo.container.jdisc.state.MetricValue
com.yahoo.container.jdisc.state.GaugeMetric
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 TypeMethodDescriptiondoubleReturns 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.longgetCount()Returns the number of assignments of this value in the time intervaldoublegetLast()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.doublegetMax()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.doublegetMin()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.Returns the 95th percentile value for this time intervaldoublegetSum()Returns the sum of all assignments of this metric in the time intervalstatic GaugeMetricnewInstance(double last, double max, double min, double sum, long count) static GaugeMetricnewInstance(double last, double max, double min, double sum, long count, Optional<List<com.yahoo.collections.Tuple2<String, Double>>> percentiles) static GaugeMetricnewSingleValue(Number val) 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).
-
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
Returns the 95th percentile value for this time interval -
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
-
newInstance
-
newInstance
public static GaugeMetric newInstance(double last, double max, double min, double sum, long count, Optional<List<com.yahoo.collections.Tuple2<String, Double>>> percentiles)
-