Class: SettableGauge

SettableGauge

Works like a Gauge, but rather than getting its value from a callback, the value
is set when needed. This can be useful for setting a gauges value for asynchronous operations.


new SettableGauge( [options])

Parameters:
Name Type Argument Description
options SettableGaugeProperties <optional>

See SettableGaugeProperties.

Implements:
Source:
Example
const settableGauge = new SettableGauge();
// Update the settable gauge ever 10'ish seconds
setInterval(() => {
    calculateSomethingAsync().then((value) => {
        settableGauge.setValue(value);
    });
}, 10000);

Methods


getType()

The type of the Metric Impl. MetricTypes.

Implements:
Source:
Returns:

The type of the Metric Impl.

Type
string

toJSON()

Implements:
Source:
Returns:

Settable Gauges directly return there current value.

Type
number