Type Definitions
-
CounterProperties
-
Properties that can be supplied to the constructor of a Counter
Type:
- Object
- Source:
Properties:
Name Type Description countnumber An initial count for the counter. Defaults to 0.
Example
// Creates a counter that starts at 5. const counter = new Counter({ count: 5 }) -
HistogramData
-
The data returned from Histogram::toJSON()
Type:
- object
- Source:
Properties:
Name Type Description minnumber | null The lowest observed value.
maxnumber | null The highest observed value.
sumnumber | null The sum of all observed values.
variancenumber | null The variance of all observed values.
meannumber | null The average of all observed values.
stddevnumber | null The stddev of all observed values.
countnumber The number of observed values.
mediannumber 50% of all values in the resevoir are at or below this value.
p75number See median, 75% percentile.
p95number See median, 95% percentile.
p99number See median, 99% percentile.
p999number See median, 99.9% percentile.
-
HistogramProperties
-
Properties to create a Histogram with.
Type:
- Object
- Source:
Properties:
Name Type Description sampleobject The sample reservoir to use. Defaults to an ExponentiallyDecayingSample.
-
MeterData
-
The data returned from Meter::toJSON()
Type:
- object
- Source:
Properties:
Name Type Description meannumber The average rate since the meter was started.
countnumber The total of all values added to the meter.
currentRatenumber The rate of the meter since the last toJSON() call.
1MinuteRatenumber The rate of the meter biased towards the last 1 minute.
5MinuteRatenumber The rate of the meter biased towards the last 5 minutes.
15MinuteRatenumber The rate of the meter biased towards the last 15 minutes.
-
MeterProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description rateUnitnumber The rate unit. Defaults to 1000 (1 sec).
tickIntervalnumber The interval in which the averages are updated. Defaults to 5000 (5 sec).
keepAliveboolean Optional flag to unref the associated timer. Defaults to
false.Example
const meter = new Meter({ rateUnit: 1000, tickInterval: 5000}) -
SettableGaugeProperties
-
Properties that can be supplied to the constructor of a Counter
Type:
- Object
- Source:
Properties:
Name Type Description initialValuenumber An initial value to use for this settable gauge. Defaults to 0.
Example
// Creates a Gauge that with an initial value of 500. const settableGauge = new SettableGauge({ initialValue: 500 }) -
StopwatchProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description getTimefunction optional function override for supplying time., defaults to new Date() / process.hrt()
-
TimerProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description meterMeter The internal meter to use. Defaults to a new Meter.
histogramHistogram The internal histogram to use. Defaults to a new Histogram.
getTimefunction optional function override for supplying time to the Stopwatch
keepAliveboolean Optional flag to unref the associated timer. Defaults to
false.
Measured