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

public final class Gauge

  1. Object
  2. Instrument
  3. Gauge
A value read when metrics are collected – a queue’s depth, a pool’s size, a @ManagedAttribute. Nothing is recorded in between, so a gauge costs nothing until something asks.

Nested types

interface Gauge.SourceWhere a gauge’s value comes from.
interface Gauge.MultiSourceWhere a gauge with several labelled values comes from – one per executor, say.

Methods

public static Map point(String key, Object label, double value)One labelled value, for a MultiSource.
public double read()The value now, or NaN when reading it failed.
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

point

public static Map point(String key, Object label, double value)
One labelled value, for a MultiSource.

read

public double read()

The value now, or NaN when reading it failed.

Application code runs here, on the exporter’s thread and on the management endpoint’s, so ANY throwable is contained – an AssertionError or LinkageError escaping used to end the exporter’s only thread, and every later export with it.

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.