Class

Metrics

Metrics(parent)

Tracks metrics.
Constructor

# new Metrics(parent)

Creates a new Metrics handler with optional parent handler. When a parent handler is defined, metrics will be automatically published upwards to the parent.
Parameters:
Name Type Default Description
parent Metrics null Optional parent for upstream metrics.

View Source metrics/Metrics.ts, line 7

Classes

Metrics
Metrics

Methods

# assignUniqueContextId(context) → {IMetricContext}

Assigns a unique ID to the context object, returning it back.
Parameters:
Name Type Description
context IMetricContext The context to modify.

View Source metrics/Metrics.ts, line 202

The provided context.
IMetricContext

# decrement(metricName, context, amount)

Decrements a metric.
Parameters:
Name Type Description
metricName string The metric name.
context IMetricContext The metric context. Expected to have a unique ID.
amount number The amount.

View Source metrics/Metrics.ts, line 186

# end(metricName, context)

Ends a timer on a metric.
Parameters:
Name Type Description
metricName string The metric name.
context IMetricContext The metric context. Expected to have a unique ID.

View Source metrics/Metrics.ts, line 168

# increment(metricName, context, amount)

Increments a metric.
Parameters:
Name Type Description
metricName string The metric name.
context IMetricContext The metric context. Expected to have a unique ID.
amount number The amount.

View Source metrics/Metrics.ts, line 177

# registerListener(listener)

Registers a metric listener.
Parameters:
Name Type Description
listener IMetricListener The listener.

View Source metrics/Metrics.ts, line 145

# reset(metricName, context)

Resets a metric.
Parameters:
Name Type Description
metricName string The metric name.
context IMetricContext The metric context. Expected to have a unique ID.

View Source metrics/Metrics.ts, line 194

# start(metricName, context)

Starts a timer on a metric.
Parameters:
Name Type Description
metricName string The metric name.
context IMetricContext The metric context. Expected to have a unique ID.

View Source metrics/Metrics.ts, line 160

# unregisterListener(listener)

De-registers a metric listener.
Parameters:
Name Type Description
listener IMetricListener The listener.

View Source metrics/Metrics.ts, line 152