Type Definitions
-
CounterProperties
-
Properties that can be supplied to the constructor of a Counter
Type:
- Object
- Source:
Properties:
Name Type Description count
number 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 min
number | null The lowest observed value.
max
number | null The highest observed value.
sum
number | null The sum of all observed values.
variance
number | null The variance of all observed values.
mean
number | null The average of all observed values.
stddev
number | null The stddev of all observed values.
count
number The number of observed values.
median
number 50% of all values in the resevoir are at or below this value.
p75
number See median, 75% percentile.
p95
number See median, 95% percentile.
p99
number See median, 99% percentile.
p999
number See median, 99.9% percentile.
-
HistogramProperties
-
Properties to create a Histogram with.
Type:
- Object
- Source:
Properties:
Name Type Description sample
object The sample reservoir to use. Defaults to an ExponentiallyDecayingSample.
-
MeterData
-
The data returned from Meter::toJSON()
Type:
- object
- Source:
Properties:
Name Type Description mean
number The average rate since the meter was started.
count
number The total of all values added to the meter.
currentRate
number The rate of the meter since the last toJSON() call.
1MinuteRate
number The rate of the meter biased towards the last 1 minute.
5MinuteRate
number The rate of the meter biased towards the last 5 minutes.
15MinuteRate
number The rate of the meter biased towards the last 15 minutes.
-
MeterProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description rateUnit
number The rate unit. Defaults to 1000 (1 sec).
tickInterval
number The interval in which the averages are updated. Defaults to 5000 (5 sec).
keepAlive
boolean 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 initialValue
number 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 getTime
function optional function override for supplying time., defaults to new Date() / process.hrt()
-
TimerProperties
-
Type:
- Object
- Source:
Properties:
Name Type Description meter
Meter The internal meter to use. Defaults to a new Meter.
histogram
Histogram The internal histogram to use. Defaults to a new Histogram.
getTime
function optional function override for supplying time to the Stopwatch
keepAlive
boolean Optional flag to unref the associated timer. Defaults to
false
.