Class InternalEventMetricType<SpecificExtraMap>

Base implementation of the event metric type, meant only for Glean internal use.

This class exposes Glean-internal properties and methods of the event metric type.

Type Parameters

Hierarchy (view full)

Constructors

Properties

allowedExtraKeys?: string[]
category: string
disabled: boolean
dynamicLabel?: string
lifetime: Lifetime
name: string
sendInPings: string[]
type: string

Methods

  • The metric's base identifier, including the category and name, but not the label.

    Returns string

    The generated identifier. If category is empty, it's omitted. Otherwise, it's the combination of the metric's category and name.

  • The metric's unique identifier, including the category, name and label.

    Returns string

    The generated identifier. If category is empty, it's omitted. Otherwise, it's the combination of the metric's category, name and label.

  • Record an event.

    Parameters

    • Optional extra: SpecificExtraMap

      optional. Used for events where additional richer context is needed. The maximum length for string values is 100 bytes.

    • timestamp: number = ...

      The event timestamp, defaults to now.

    Returns void

  • Verify whether or not this metric instance should be recorded.

    Parameters

    • uploadEnabled: boolean

      Whether or not global upload is enabled or disabled.

    Returns boolean

    Whether or not this metric instance should be recorded.

  • Test-only API

    Gets the currently stored events.

    This doesn't clear the stored value.

    Parameters

    • ping: string = ...

      the ping from which we want to retrieve this metrics value from. Defaults to the first value in sendInPings.

    Returns undefined | Event[]

    The value found in storage or undefined if nothing was found.

Generated using TypeDoc