Skip to main content

Interface: MetricCounter

common.MetricCounter

A metric that supports adding values as a counter.

The Metric API is an experimental feature and may be subject to change.

Hierarchy

Properties

description

Optional description: string

The description of the metric, if any.

Inherited from

Metric.description


name

name: string

The name of the metric.

Inherited from

Metric.name


unit

Optional unit: string

The unit of the metric, if any.

Inherited from

Metric.unit

Methods

add

add(value, extraTags?): void

Add the given value to the counter.

Parameters

NameTypeDescription
valuenumberValue to add.
extraTags?MetricTagsExtra tags if any.

Returns

void


withTags

withTags(tags): MetricCounter

Return a clone of this counter, with additional tags.

Parameters

NameTypeDescription
tagsMetricTagsTags to append to existing tags.

Returns

MetricCounter