Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Stats

Package version

Main interface for stats.

Hierarchy

  • Stats

Index

Methods

clear

  • clear(): void
  • Remove all registered Views and exporters from the stats.

    Returns void

createMeasureDouble

  • createMeasureDouble(name: string, unit: MeasureUnit, description?: undefined | string): Measure
  • Creates a measure of type Double.

    Parameters

    • name: string

      The measure name

    • unit: MeasureUnit

      The measure unit

    • Optional description: undefined | string

      The measure description

    Returns Measure

createMeasureInt64

  • createMeasureInt64(name: string, unit: MeasureUnit, description?: undefined | string): Measure
  • Creates a measure of type Int64. Values must be integers up to Number.MAX_SAFE_INTERGER.

    Parameters

    • name: string

      The measure name

    • unit: MeasureUnit

      The measure unit

    • Optional description: undefined | string

      The measure description

    Returns Measure

createView

  • Creates a view.

    Parameters

    • name: string

      The view name

    • measure: Measure

      The view measure

    • aggregation: AggregationType

      The view aggregation type

    • tagKeys: TagKey[]

      The view columns (tag keys)

    • description: string

      The view description

    • Optional bucketBoundaries: number[]

      The view bucket boundaries for a distribution aggregation type

    Returns View

getCurrentTagContext

  • getCurrentTagContext(): TagMap
  • Gets the current tag context.

    Returns TagMap

getMetrics

  • Gets a collection of produced Metric`s to be exported.

    Returns Metric[]

    The List of metrics.

record

  • record(measurements: Measurement[], tags?: TagMap, attachments?: undefined | object): void
  • Updates all views with the new measurements.

    Parameters

    • measurements: Measurement[]

      A list of measurements to record

    • Optional tags: TagMap

      optional The tags to which the value is applied. tags could either be explicitly passed to the method, or implicitly read from current execution context.

    • Optional attachments: undefined | object

      optional The contextual information associated with an example value. The contextual information is represented as key - value string pairs.

    Returns void

registerExporter

  • Registers an exporter to send stats data to a service.

    Parameters

    Returns void

registerView

  • registerView(view: View): void
  • Registers a view to listen to new measurements in its measure.

    Parameters

    • view: View

      The view to be registered

    Returns void

unregisterExporter

  • Unregisters an exporter. It should be called whenever the exporter is not needed anymore.

    Parameters

    Returns void

withTagContext

  • Enters the scope of code where the given TagMap is in the current context (replacing the previous TagMap).

    Type parameters

    • T

    Parameters

    • tags: TagMap

      The TagMap to be set to the current context.

    • fn: Func<T>

      Callback function.

    Returns T

    The callback return.

Generated using TypeDoc