This class holds all of the Glean singleton's state and internal dependencies.

It is necessary so that internal modules don't need to import Glean directly. Doing that should be avoided at all costs because that singleton imports most of our internal modules by value. That causes bad circular dependency issues, due to the module being imported by Glean and also importing Glean.

This singleton breaks the cycle, by serving as a bridge between the Glean singleton and the internal modules. All of the imports in this file should be import type which only matter for Typescript and don't cause circular dependency issues.

Constructors

Properties

applicationId: string
coreMetrics: CoreMetrics
corePings: default
errorManager: default
eventsDatabase: EventsDatabase
initialized: boolean = false
metricsDatabase: default
pingsDatabase: default
platform: default
startTime: Date
supportedMetrics: {
    [type: string]: (new (v) => Metric<JSONValue, JSONValue>);
} = {}

Type declaration

testing: boolean = false
uploadEnabled: boolean
_instance?: Context

Accessors

Methods

  • Test-only API

    Resets the Context to an uninitialized state.

    Returns void

Generated using TypeDoc