Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class Histogram

  1. Object
  2. Instrument
  3. 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.

Methods

public static double[] defaultBounds()A copy of OpenTelemetry’s default explicit bucket boundaries.
public String[] getLabelKeys()The label keys this histogram was created with.
public void record(double value)Records one value in the series without labels.
public void record(double value, Object first, Object second, Object third)Records one value in the series for these label values, given in the order of the keys the histogram was created with.
public List points()The current points, each a map with attributes (a map, possibly empty) and either value or, for a histogram, count, sum, min, max, bounds and buckets.

Inherited fields

Inherited methods

Method details

defaultBounds

public static double[] defaultBounds()
A copy of OpenTelemetry’s default explicit bucket boundaries.

getLabelKeys

public String[] getLabelKeys()
The label keys this histogram was created with.

record

public void record(double value)
Records one value in the series without labels.

record

public void record(double value, Object first, Object second, Object third)
Records one value in the series for these label values, given in the order of the keys the histogram was created with.

points

public List points()
The current points, each a map with attributes (a map, possibly empty) and either value or, for a histogram, count, sum, min, max, bounds and buckets.