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 (view full)

Constructors

Properties

Accessors

  • get date(): Date
  • Gets the datetime data as a Date object.

    Note

    The object created here will be relative to local time. If the timezone at the time of recording is different, the timezone offset will be applied before transforming to an object.

    Returns Date

    A date object.

Methods

  • Gets this metrics value in its payload representation.

    For this metric, the payload is the timezone aware ISO date string truncated to the time unit given at the time of recording.

    Note

    The timezone of the final string is the timezone at the time of recording.

    Returns string

    The metric value.

Generated using TypeDoc