Class Histogram
java.lang.Object
com.codename1.backend.metrics.Instrument
com.codename1.backend.metrics.Histogram
A distribution of values -- durations, sizes -- kept as counts per bucket. Exported as a cumulative explicit-bucket histogram.
The buckets are fixed when the histogram is created; the default boundaries are OpenTelemetry's, which suit milliseconds.
A histogram created with label keys keeps a series per combination of label values -- the server's request histogram has route, method and status. The series are found by a map lookup on the first label, which is a constant such as a route template, so nothing new is hashed; and they are capped, so a label with unbounded values cannot grow the histogram without limit.
-
Field Summary
Fields inherited from class Instrument
COUNTER, GAUGE, HISTOGRAM, UP_DOWN_COUNTER -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]A copy of OpenTelemetry's default explicit bucket boundaries.longgetCount()Every value recorded so far, across all label sets: what a@Timedmethod's timer or a histogram reads as in the process, without an exporter.String[]The label keys this histogram was created with.doublegetMean()The mean of the values recorded so far, or NaN when there are none.doublegetSum()The sum of every value recorded so far, across all label sets.points()The current points, each a map withattributes(a map, possibly empty) and eithervalueor, for a histogram,count,sum,min,max,boundsandbuckets.voidrecord(double value) Records one value in the series without labels.voidRecords one value in the series for these label values, given in the order of the keys the histogram was created with.Methods inherited from class Instrument
getDescription, getKind, getName, getUnit
-
Method Details
-
defaultBounds
public static double[] defaultBounds()A copy of OpenTelemetry's default explicit bucket boundaries. -
getLabelKeys
The label keys this histogram was created with. -
record
public void record(double value) Records one value in the series without labels. -
record
-
getCount
public long getCount()Every value recorded so far, across all label sets: what a@Timedmethod's timer or a histogram reads as in the process, without an exporter. -
getSum
public double getSum()The sum of every value recorded so far, across all label sets. -
getMean
public double getMean()The mean of the values recorded so far, or NaN when there are none. -
points
Description copied from class:InstrumentThe current points, each a map withattributes(a map, possibly empty) and eithervalueor, for a histogram,count,sum,min,max,boundsandbuckets.- Specified by:
pointsin classInstrument
-