Skip to main content

@webda/coreReadme | API


Class: Histogram<T>

A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets

Type parameters

T extends string = string

Constructors

new Histogram(configuration)

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

Parameters

configuration: HistogramConfiguration<T>

Configuration when creating the Histogram. Name and Help is mandatory

Returns

Histogram<T>

Source

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

Methods

get()

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

Get histogram metric object

Returns

Promise<MetricObjectWithValues<MetricValueWithName<T>>>

Source

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


labels()

labels(values)

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

Return the child for given labels

Parameters

• ...values: string[]

Label values

Returns

Internal<T>

Configured histogram with given labels

Source

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

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


observe()

observe(value)

observe(value): void

Observe value

Parameters

value: number

The value to observe

Returns

void

Source

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

observe(labels, value)

observe(labels, value): void

Observe value for given labels

Parameters

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

Object with label keys and values

value: number

The value to observe

Returns

void

Source

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

observe(observeData)

observe(observeData): void

Observe with exemplars

Parameters

observeData: ObserveDataWithExemplar<T>

Object with labels, value and exemplars for an observation

Returns

void

Source

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


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

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


reset()

reset(): void

Reset histogram values

Returns

void

Source

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


startTimer()

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

Start a timer. Calling the returned function will observe the duration in seconds in the histogram.

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


zero()

zero(labels): void

Initialize the metrics for the given combination of labels to zero

Parameters

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

Returns

void

Source

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