The Metric class describes the shared behaviour amongst concrete metrics.

A concrete metric will always have two possible representations:

  • InternalRepresentation
    • Is the format in which this metric will be stored in memory.
    • This format may contain extra metadata, in order to allow deserializing of this data for testing purposes.
  • PayloadRepresentation
    • Is the format in which this metric will be represented in the ping payload.
    • This format must be the exact same as described in the Glean schema.

Hierarchy

  • Metric<number, number>
    • CounterMetric

Constructors

Properties

_inner: number

Methods

  • Validates a given value using the validation function and throws in case it is not valid.

    Returns

    v if it is valid.

    Parameters

    • v: unknown

      The value to verify.

    Returns number

Generated using TypeDoc