Skip to main content

Class: MetricsContext

Constructors

constructor

new MetricsContext()

Methods

addMetrics

addMetrics(namespace, definitions): void

Parameters

NameType
namespacestring
definitions[MetricsDefinition](../API Reference#metricsdefinition)

Returns

void


createReportProducer

createReportProducer(onReport, interval, abortSignal, formatNumber?): void

Parameters

NameType
onReport(report: [MetricsReport](../API Reference#metricsreport)) => void
intervalnumber
abortSignalAbortSignal
formatNumber?(value: number) => string

Returns

void


getMetric

getMetric(id): undefined | Metric

Parameters

NameType
idstring

Returns

undefined | Metric