Skip to content

@ralphschuler.prom metrics decorator.<internal>.Counter

github-actions edited this page Nov 26, 2023 · 1 revision

Class: Counter<T>

@ralphschuler/prom-metrics-decorator.<internal>.Counter

A counter is a cumulative metric that represents a single numerical value that only ever goes up

Type parameters

Name Type
T extends string = string

Table of contents

Constructors

Methods

Constructors

constructor

new Counter<T>(configuration): Counter<T>

Type parameters

Name Type
T extends string = string

Parameters

Name Type Description
configuration CounterConfiguration<T> Configuration when creating a Counter metric. Name and Help is required.

Returns

Counter<T>

Defined in

node_modules/prom-client/index.d.ts:184

Methods

get

get(): Promise<MetricObjectWithValues<MetricValue<T>>>

Get counter metric object

Returns

Promise<MetricObjectWithValues<MetricValue<T>>>

Defined in

node_modules/prom-client/index.d.ts:202


inc

inc(labels, value?): void

Increment for given labels

Parameters

Name Type Description
labels Partial<Record<T, string | number>> Object with label keys and values
value? number The number to increment with

Returns

void

Defined in

node_modules/prom-client/index.d.ts:191

inc(value?): void

Increment with value

Parameters

Name Type Description
value? number The value to increment with

Returns

void

Defined in

node_modules/prom-client/index.d.ts:197


labels

labels(...values): Internal

Return the child for given labels

Parameters

Name Type Description
...values string[] Label values

Returns

Internal

Configured counter with given labels

Defined in

node_modules/prom-client/index.d.ts:209

labels(labels): Internal

Return the child for given labels

Parameters

Name Type Description
labels Partial<Record<T, string | number>> Object with label keys and values

Returns

Internal

Configured counter with given labels

Defined in

node_modules/prom-client/index.d.ts:216


remove

remove(...values): void

Remove metrics for the given label values

Parameters

Name Type Description
...values string[] Label values

Returns

void

Defined in

node_modules/prom-client/index.d.ts:227

remove(labels): void

Remove metrics for the given label values

Parameters

Name Type Description
labels Partial<Record<T, string | number>> Object with label keys and values

Returns

void

Defined in

node_modules/prom-client/index.d.ts:233


reset

reset(): void

Reset counter values

Returns

void

Defined in

node_modules/prom-client/index.d.ts:221

Typescript Libraries

Modules

Namespaces

Clone this wiki locally