The events database is an abstraction layer on top of the underlying storage.

Event data is saved to the database in the following format:

{ "pingName": { [ { "timestamp": 0, "category": "something", "name": "other", "extra": {...} }, ... ] } }

Events only support Ping lifetime.

Constructors

Properties

eventsStore: default
initialized: boolean = false

Methods

  • Helper function to validate and get a specific lifetime data related to a ping from the underlying storage.

    Note

    If the value in storage for any of the metrics in the ping is of an unexpected type, the whole ping payload for that lifetime will be thrown away.

    Parameters

    • ping: string

      The ping we want to get the data from

    Returns RecordedEvent[]

    The ping payload found for the given parameters or an empty object in case no data was found or the data that was found, was invalid.

  • Prepares the events payload.

    1. Sorts event by execution counter and timestamp;
    2. Applies offset to events timestamps;
    3. Removes the first event if it is a glean.restarted event;
    4. Removes reserved extra keys and stringifies all extras values;
    5. Removes all trailing glean.restarted events (if they exists);

    Parameters

    • pingName: string

      The name of the ping for which the payload is being prepared.

    • pingData: RecordedEvent[]

      An unsorted list of events.

    Returns JSONArray

    An array of sorted events.

Generated using TypeDoc