Skip to main content

Class: MetricsContext

Constructors

constructor

new MetricsContext()

Methods

addMetrics

addMetrics(namespace, definitions): void

Parameters

NameType
namespacestring
definitionsMetricsDefinition

Returns

void


createReportProducer

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

Parameters

NameType
onReport(report: MetricsReport) => void
intervalnumber
abortSignalAbortSignal
formatNumber?(value: number) => string

Returns

void


getMetric

getMetric(id): undefined | Metric

Parameters

NameType
idstring

Returns

undefined | Metric