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

Hierarchy

  • Counter

Constructors

Methods

Constructors

  • Type Parameters

    • T extends string = string

    Parameters

    • configuration: CounterConfiguration<T>

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

    Returns Counter<T>

Methods

  • Get counter metric object

    Returns Promise<MetricObjectWithValues<MetricValue<T>>>

  • Increment for given labels

    Parameters

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

      Object with label keys and values

    • Optional value: number

      The number to increment with

      Optional

    Returns void

  • Increment with value

    Parameters

    • Optional value: number

      The value to increment with

      Optional

    Returns void

  • Return the child for given labels

    Parameters

    • Rest ...values: string[]

      Label values

      Rest

    Returns Counter.Internal

    Configured counter with given labels

  • Return the child for given labels

    Parameters

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

      Object with label keys and values

    Returns Counter.Internal

    Configured counter with given labels

  • Remove metrics for the given label values

    Parameters

    • Rest ...values: string[]

      Label values

      Rest

    Returns void

  • Remove metrics for the given label values

    Parameters

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

      Object with label keys and values

    Returns void

  • Reset counter values

    Returns void

Generated using TypeDoc