Extended INotificationListener interface for SDK Stats that includes flush and unload operations.

interface ISdkStatsNotifCbk {
    eventsDiscarded?: ((events: ITelemetryItem[], reason: number, sendType?: number) => void);
    eventsRetry?(events: ITelemetryItem[], statusCode: number): void;
    eventsSendRequest?: ((sendReason: number, isAsync?: boolean) => void);
    eventsSent?: ((events: ITelemetryItem[]) => void);
    flush: (() => void);
    offlineBatchDrop?(cnt: number, reason?: number): void;
    offlineBatchSent?(batch: IPayloadData): void;
    offlineEventsStored?(events: ITelemetryItem[]): void;
    perfEvent?: ((perfEvent: IPerfEvent) => void);
    unload: (() => void);
}

Hierarchy (view full)

Properties

eventsDiscarded?: ((events: ITelemetryItem[], reason: number, sendType?: number) => void)

[Optional] A function called when events are discarded.

Type declaration

    • (events, reason, sendType?): void
    • Parameters

      • events: ITelemetryItem[]

        The array of events that have been discarded.

      • reason: number

        The reason for discarding the events. The EventsDiscardedReason constant should be used to check the different values.

      • OptionalsendType: number

        [Optional] The send type used when the events were discarded.

      Returns void

eventsSendRequest?: ((sendReason: number, isAsync?: boolean) => void)

[Optional] A function called when the events have been requested to be sent to the sever.

Type declaration

    • (sendReason, isAsync?): void
    • Parameters

      • sendReason: number

        The reason why the event batch is being sent.

      • OptionalisAsync: boolean

        A flag which identifies whether the requests are being sent in an async or sync manner.

      Returns void

eventsSent?: ((events: ITelemetryItem[]) => void)

[Optional] A function called when events are sent.

Type declaration

    • (events): void
    • Parameters

      Returns void

flush: (() => void)

Flush accumulated counts and emit metrics via the configured track function.

perfEvent?: ((perfEvent: IPerfEvent) => void)

[Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging the event can be displayed via the debug plugin extension.

Type declaration

    • (perfEvent): void
    • Parameters

      • perfEvent: IPerfEvent

        The performance event object

      Returns void

unload: (() => void)

Flush remaining counts and cancel the timer.

Methods