Counter
A counter is a cumulative metric that represents a single numerical value that only ever goes up
class Counter<T extends string = string> {}
constructor(configuration: CounterConfiguration<T>);
get(): Promise<MetricObjectWithValues<MetricValue<T>>>;
inc(labels: LabelValues<T>, value?: number): void;
inc(value?: number): void;
remove(...values: string[]): void;
remove(labels: LabelValues<T>): void;
reset(): void;
§Constructors
§
new Counter(configuration: CounterConfiguration<T>)
[src]@param configuration
Configuration when creating a Counter metric. Name and Help is required.
§Methods
§
inc(labels: LabelValues<T>, value?: number): void
[src]Increment for given labels
@param labels
Object with label keys and values
@param value
The number to increment with
inc(value?: number): void
[src]Increment with value
@param value
The value to increment with
§
labels(...values: string[]): Counter.Internal
[src]Return the child for given labels
@param values
Label values
@return
Configured counter with given labels
labels(labels: LabelValues<T>): Counter.Internal
[src]Return the child for given labels
@param labels
Object with label keys and values
@return
Configured counter with given labels