Skip to main content

@webda/coreReadme | API


Class: Counter<T>

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

Type parameters

T extends string = string

Constructors

new Counter(configuration)

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

Parameters

configuration: CounterConfiguration<T>

Configuration when creating a Counter metric. Name and Help is required.

Returns

Counter<T>

Source

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

Methods

get()

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

Get counter metric object

Returns

Promise<MetricObjectWithValues<MetricValue<T>>>

Source

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


inc()

inc(labels, value)

inc(labels, value?): void

Increment for given labels

Parameters

labels: Partial<Record<T, string | number>>

Object with label keys and values

value?: number

The number to increment with

Returns

void

Source

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

inc(value)

inc(value?): void

Increment with value

Parameters

value?: number

The value to increment with

Returns

void

Source

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

inc(incData)

inc(incData): void

Increment with exemplars

Parameters

incData: IncreaseDataWithExemplar<T>

Object with labels, value and exemplars for an increase

Returns

void

Source

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


labels()

labels(values)

labels(...values): Internal

Return the child for given labels

Parameters

• ...values: string[]

Label values

Returns

Internal

Configured counter with given labels

Source

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

labels(labels)

labels(labels): Internal

Return the child for given labels

Parameters

labels: Partial<Record<T, string | number>>

Object with label keys and values

Returns

Internal

Configured counter with given labels

Source

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


remove()

remove(values)

remove(...values): void

Remove metrics for the given label values

Parameters

• ...values: string[]

Label values

Returns

void

Source

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

remove(labels)

remove(labels): void

Remove metrics for the given label values

Parameters

labels: Partial<Record<T, string | number>>

Object with label keys and values

Returns

void

Source

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


reset()

reset(): void

Reset counter values

Returns

void

Source

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