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

public abstract class Instrument

  1. Object
  2. Instrument

Known subtypesCounter, Gauge, Histogram

One named measurement: a counter, a gauge or a histogram.

Created once through Metrics and kept – the build’s generated code holds each in a static field – so recording a value never looks anything up.

Fields

public static final int COUNTER = 0
public static final int UP_DOWN_COUNTER = 1
public static final int GAUGE = 2
public static final int HISTOGRAM = 3

Methods

public String getName()
public String getDescription()
public String getUnit()
public int getKind()COUNTER, UP_DOWN_COUNTER, GAUGE or HISTOGRAM.
public abstract 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 methods

Field details

COUNTER

public static final int COUNTER = 0

UP_DOWN_COUNTER

public static final int UP_DOWN_COUNTER = 1

GAUGE

public static final int GAUGE = 2

HISTOGRAM

public static final int HISTOGRAM = 3

Method details

getName

public String getName()

getDescription

public String getDescription()

getUnit

public String getUnit()

getKind

public int getKind()

points

public abstract 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.