A simple interface for listening for Metric updates. Should be plugged into
something like Prometheus for recording.
Metric names are defined in metric_names.ts - see documentation on the name
for what the context object contains. All metrics have a context object,
with applicable interface. See the IMetricContext interface for more
information.
Members
Methods
# onDecrement(metricName, context, amount)
Called when a linear metric (increasing/decreasing number) should
be decremented.
Parameters:
Name | Type | Description |
---|---|---|
metricName |
string
|
The metric being called. |
context |
IMetricContext
|
Context for the metric. Never null. |
amount |
number
|
The amount to subtract. Never negative or zero. |
# onIncrement(metricName, context, amount)
Called when a linear metric (increasing/decreasing number) should
be incremented.
Parameters:
Name | Type | Description |
---|---|---|
metricName |
string
|
The metric being called. |
context |
IMetricContext
|
Context for the metric. Never null. |
amount |
number
|
The amount to add. Never negative or zero. |
# onReset(metricName, context)
Called when a linear metric (increasing/decreasing number) should
be reset to zero.
Parameters:
Name | Type | Description |
---|---|---|
metricName |
string
|
The metric being called. |
context |
IMetricContext
|
Context for the metric. Never null. |