new Gauge(readFn)
Parameters:
Name | Type | Description |
---|---|---|
readFn |
function | A function that returns the numeric value for this gauge. |
- Implements:
- Source:
Example
var Measured = require('measured') var gauge = new Measured.Gauge(function() { return process.memoryUsage().rss; });
Methods
-
getType()
-
The type of the Metric Impl. MetricTypes.
- Implements:
- Source:
Returns:
The type of the Metric Impl.
- Type
- string
-
toJSON()
-
- Implements:
- Source:
Returns:
Gauges directly return the value from the callback which should be a number.
- Type
- number