Skip to main content

@webda/coreReadme | API


Class: Gauge<T>

A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.

Type parameters

T extends string = string

Constructors

new Gauge(configuration)

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

Parameters

configuration: GaugeConfiguration<T>

Configuration when creating a Gauge metric. Name and Help is mandatory

Returns

Gauge<T>

Source

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

Methods

dec()

dec(labels, value)

dec(labels, value?): void

Decrement gauge

Parameters

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

Object with label keys and values

value?: number

Value to decrement with

Returns

void

Source

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

dec(value)

dec(value?): void

Decrement gauge

Parameters

value?: number

The value to decrement with

Returns

void

Source

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


get()

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

Get gauge metric object

Returns

Promise<MetricObjectWithValues<MetricValue<T>>>

Source

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


inc()

inc(labels, value)

inc(labels, value?): void

Increment gauge for given labels

Parameters

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

Object with label keys and values

value?: number

The value to increment with

Returns

void

Source

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

inc(value)

inc(value?): void

Increment gauge

Parameters

value?: number

The value to increment with

Returns

void

Source

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


labels()

labels(values)

labels(...values): Internal<T>

Return the child for given labels

Parameters

• ...values: string[]

Label values

Returns

Internal<T>

Configured gauge with given labels

Source

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

labels(labels)

labels(labels): Internal<T>

Return the child for given labels

Parameters

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

Object with label keys and values

Returns

Internal<T>

Configured counter with given labels

Source

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


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:410

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:416


reset()

reset(): void

Reset gauge values

Returns

void

Source

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


set()

set(labels, value)

set(labels, value): void

Set gauge value for labels

Parameters

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

Object with label keys and values

value: number

The value to set

Returns

void

Source

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

set(value)

set(value): void

Set gauge value

Parameters

value: number

The value to set

Returns

void

Source

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


setToCurrentTime()

setToCurrentTime(labels?): void

Set gauge value to current epoch time in seconds

Parameters

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

Object with label keys and values

Returns

void

Source

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


startTimer()

startTimer(labels?): (labels?) => number

Start a timer. Calling the returned function will set the gauge's value to the observed duration in seconds.

Parameters

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

Object with label keys and values

Returns

Function

Function to invoke when timer should be stopped. The value it returns is the timed duration.

Parameters

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

Returns

number

Source

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