Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Summary

A summary samples observations

class Summary<T extends string = string> {
constructor(configuration: SummaryConfiguration<T>);
get(): Promise<MetricObjectWithValues<MetricValueWithName<T>>>;
labels(...values: string[]): Summary.Internal<T>;
labels(labels: LabelValues<T>): Summary.Internal<T>;
observe(value: number): void;
observe(labels: LabelValues<T>, value: number): void;
remove(...values: string[]): void;
remove(labels: LabelValues<T>): void;
reset(): void;
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;
}

§Type Parameters

§
T extends string = string
[src]

§Constructors

§
new Summary(configuration: SummaryConfiguration<T>)
[src]
@param configuration

Configuration when creating Summary metric. Name and Help is mandatory

§Methods

§
get(): Promise<MetricObjectWithValues<MetricValueWithName<T>>>
[src]

Get summary metric object

§
labels(...values: string[]): Summary.Internal<T>
[src]

Return the child for given labels

@param values

Label values

@return

Configured summary with given labels

labels(labels: LabelValues<T>): Summary.Internal<T>
[src]

Return the child for given labels

@param labels

Object with label keys and values

@return

Configured counter with given labels

§
observe(value: number): void
[src]

Observe value in summary

@param value

The value to observe

observe(labels: LabelValues<T>, value: number): void
[src]

Observe value for given labels

@param labels

Object with label keys and values

@param value

Value to observe

§
remove(...values: string[]): void
[src]

Remove metrics for the given label values

@param values

Label values

remove(labels: LabelValues<T>): void
[src]

Remove metrics for the given label values

@param labels

Object with label keys and values

§
reset(): void
[src]

Reset all values in the summary

§
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number
[src]

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

@param labels

Object with label keys and values

@return

Function to invoke when timer should be stopped