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.String[]The label keys this histogram was created with.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
-
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
-