Class: AgeCounters

AgeCounters()

A small helper object that counts into buckets the number of calls to its bump that fall into the given age categories. Counts are maintained within the object, and can be fetched to set into a gauge metric object. This class is useful when exporting metrics that count the number of hourly/daily/weekly active instances of various types of object within the bridge.

Constructor

new AgeCounters()

Source:

Methods

bump(age)

Increment the values of the internal counters depending on the given age, in seconds.
Parameters:
Name Type Description
age Number The age in seconds.
Source:

setGauge(gauge, morelabels)

Fetch the counts in the age buckets and set them as labeled observations in the given gauge metric instance.
Parameters:
Name Type Description
gauge Gauge The gauge metric instance.
morelabels Object An object containing more labels to add to the gauge when setting values.
Source: