new Meter( [properties])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
properties |
MeterProperties |
<optional> |
see MeterProperties. |
- Implements:
- Source:
Example
var Measured = require('measured') var meter = new Measured.Meter(); http.createServer(function(req, res) { meter.mark(); });
Methods
-
getType()
-
The type of the Metric Impl. MetricTypes.
- Implements:
- Source:
Returns:
The type of the Metric Impl.
- Type
- string
-
mark( [n])
-
Register n events as having just occured. Defaults to 1.
Parameters:
Name Type Argument Description n
number <optional>
-
ref()
-
Refs the backing timer again. Idempotent.
-
reset()
-
Resets all values. Meters initialized with custom options will be reset to the default settings (patch welcome).
-
toJSON()
-
- Implements:
- Source:
Returns:
- Type
- MeterData
-
unref()
-
Unrefs the backing timer. The meter will not keep the event loop alive. Idempotent.