Options
All
  • Public
  • Public/Protected
  • All
Menu

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

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

Hierarchy

Index

Constructors

Properties

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

Methods

  • baseIdentifier(): string
  • 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 ommitted. Otherwise, it's the combination of the metric's category and name.

  • identifier(): Promise<string>
  • The metric's unique identifier, including the category, name and label.

    Returns Promise<string>

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

  • set(value?: Date): void
  • setUndispatched(value?: Date): Promise<void>
  • An implemention of set that does not dispatch the recording task.

    Important

    This method should never be exposed to users.

    Parameters

    • Optional value: Date

      The date we want to set to.

    Returns Promise<void>

  • shouldRecord(uploadEnabled: boolean): boolean
  • 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.

  • testGetNumRecordedErrors(errorType: string, ping?: string): Promise<number>
  • testGetValue(ping?: string): Promise<undefined | Date>
  • testGetValueAsDatetimeMetric(ping: string, fn: string): Promise<undefined | DatetimeMetric>
  • Test-only API

    Gets the currently stored value as a DatetimeMetric.

    This doesn't clear the stored value.

    Parameters

    • ping: string

      The ping from which we want to retrieve this metrics value from.

    • fn: string

      The name of the function that is calling this function. Used for testing purposes.

    Returns Promise<undefined | DatetimeMetric>

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

  • testGetValueAsString(ping?: string): Promise<undefined | string>

Generated using TypeDoc