Class Summary<T>

A summary samples observations

Type Parameters

  • T extends string = string

Hierarchy

  • Summary

Constructors

  • Type Parameters

    • T extends string = string

    Parameters

    • configuration: SummaryConfiguration<T>

      Configuration when creating Summary metric. Name and Help is mandatory

    Returns Summary<T>

Methods

  • Get summary metric object

    Returns Promise<MetricObjectWithValues<MetricValueWithName<T>>>

  • Return the child for given labels

    Parameters

    • Rest ...values: string[]

      Label values

      Rest

    Returns Summary.Internal<T>

    Configured summary with given labels

  • Return the child for given labels

    Parameters

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

      Object with label keys and values

    Returns Summary.Internal<T>

    Configured counter with given labels

  • Observe value in summary

    Parameters

    • value: number

      The value to observe

    Returns void

  • Observe value for given labels

    Parameters

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

      Object with label keys and values

    • value: number

      Value to observe

    Returns void

  • 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 all values in the summary

    Returns void

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

    Parameters

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

      Object with label keys and values

      Optional

    Returns ((labels?) => number)

    Function to invoke when timer should be stopped

      • (labels?): number
      • Start a timer. Calling the returned function will observe the duration in seconds in the summary.

        Parameters

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

          Object with label keys and values

          Optional

        Returns number

        Function to invoke when timer should be stopped

Generated using TypeDoc