Options
All
  • Public
  • Public/Protected
  • All
Menu

Stores information about a ping.

This is required so that given metric data queued on disk we can send pings with the correct settings, e.g. whether it has a client_id.

Hierarchy

  • default

Implements

Index

Constructors

constructor

Properties

Readonly includeClientId

includeClientId: boolean

Readonly name

name: string

Readonly reasonCodes

reasonCodes: string[]

Private Optional rejectTestPromiseFunction

rejectTestPromiseFunction?: PromiseCallback

Private Optional resolveTestPromiseFunction

resolveTestPromiseFunction?: PromiseCallback

Readonly sendIfEmpty

sendIfEmpty: boolean

Private Optional testCallback

testCallback?: ValidatorFunction

Methods

Private isDeletionRequest

  • isDeletionRequest(): boolean

submit

  • submit(reason?: string): void
  • Collects and submits a ping for eventual uploading.

    The ping content is assembled as soon as possible, but upload is not guaranteed to happen immediately, as that depends on the upload policies.

    If the ping currently contains no content, it will not be sent, unless it is configured to be sent if empty.

    Parameters

    • Optional reason: string

      The reason the ping was triggered. Included in the ping_info.reason part of the payload.

    Returns void

testBeforeNextSubmit

  • testBeforeNextSubmit(callbackFn: ValidatorFunction): Promise<void>
  • Test-only API**

    Runs a validation function before the ping is collected.

    Parameters

    • callbackFn: ValidatorFunction

      The asynchronous validation function to run in order to validate the ping content.

    Returns Promise<void>

    A Promise resolved when the ping is collected and the validation function is executed.

Static Private _private_internalSubmit

  • _private_internalSubmit(instance: default, reason?: string, testResolver?: PromiseCallback): void

Static _private_submitUndispatched

  • _private_submitUndispatched(instance: default, reason?: string, testResolver?: PromiseCallback): Promise<void>
  • An internal implemention of submit that does not dispatch the submission task.

    Important

    This is absolutely not meant to be used outside of Glean itself. It may cause multiple issues because it cannot guarantee that the submission of the ping will happen in order with other Glean API calls.

    Parameters

    • instance: default

      The ping instance to submit.

    • Optional reason: string

      The reason the ping was triggered. Included in the ping_info.reason part of the payload.

    • Optional testResolver: PromiseCallback

      The asynchronous validation function to run in order to validate the ping content.

    Returns Promise<void>

Generated using TypeDoc