Editar

Compartilhar via


BrowserPerformanceClient class

Extends

PerformanceClient

Constructors

BrowserPerformanceClient(string, string, Logger, string, string, ApplicationTelemetry, CryptoOptions)

Methods

generateId()
startMeasurement(PerformanceEvents, string)

Starts measuring performance for a given operation. Returns a function that should be used to end the measurement. Also captures browser page visibilityState.

startPerformanceMeasuremeant(string, string)

Inherited Methods

addPerformanceCallback(PerformanceCallbackFunction)

Registers a callback function to receive performance events.

addStaticFields(StaticFields, string)

Saves extra information to be emitted when the measurements are flushed

discardMeasurements(string)

Removes measurements for a given correlation id.

emitEvents(PerformanceEvent[], string)

Emits events to all registered callbacks.

endMeasurement(PerformanceEvent)

Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes, as consumers should instead use the function returned by startMeasurement.

flushMeasurements(PerformanceEvents, string)

Gathers and emits performance events for measurements taked for the given top-level API and correlation ID.

removePerformanceCallback(string)

Removes a callback registered with addPerformanceCallback.

Constructor Details

BrowserPerformanceClient(string, string, Logger, string, string, ApplicationTelemetry, CryptoOptions)

new BrowserPerformanceClient(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, cryptoOptions: CryptoOptions)

Parameters

clientId

string

authority

string

logger

Logger

libraryName

string

libraryVersion

string

applicationTelemetry

ApplicationTelemetry

cryptoOptions
CryptoOptions

Method Details

generateId()

function generateId(): string

Returns

string

startMeasurement(PerformanceEvents, string)

Starts measuring performance for a given operation. Returns a function that should be used to end the measurement. Also captures browser page visibilityState.

function startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent

Parameters

measureName

PerformanceEvents

correlationId

string

Returns

InProgressPerformanceEvent

startPerformanceMeasuremeant(string, string)

function startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement

Parameters

measureName

string

correlationId

string

Returns

IPerformanceMeasurement

Inherited Method Details

addPerformanceCallback(PerformanceCallbackFunction)

Registers a callback function to receive performance events.

function addPerformanceCallback(callback: PerformanceCallbackFunction): string

Parameters

callback

PerformanceCallbackFunction

Returns

string

Inherited From PerformanceClient.addPerformanceCallback

addStaticFields(StaticFields, string)

Saves extra information to be emitted when the measurements are flushed

function addStaticFields(fields: StaticFields, correlationId: string)

Parameters

fields

StaticFields

correlationId

string

Inherited From PerformanceClient.addStaticFields

discardMeasurements(string)

Removes measurements for a given correlation id.

function discardMeasurements(correlationId: string)

Parameters

correlationId

string

Inherited From PerformanceClient.discardMeasurements

emitEvents(PerformanceEvent[], string)

Emits events to all registered callbacks.

function emitEvents(events: PerformanceEvent[], correlationId: string)

Parameters

events

PerformanceEvent[]

correlationId

string

Inherited From PerformanceClient.emitEvents

endMeasurement(PerformanceEvent)

Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes, as consumers should instead use the function returned by startMeasurement.

function endMeasurement(event: PerformanceEvent): PerformanceEvent | null

Parameters

event

PerformanceEvent

Returns

PerformanceEvent | null

Inherited From PerformanceClient.endMeasurement

flushMeasurements(PerformanceEvents, string)

Gathers and emits performance events for measurements taked for the given top-level API and correlation ID.

function flushMeasurements(measureName: PerformanceEvents, correlationId: string)

Parameters

measureName

PerformanceEvents

correlationId

string

Inherited From PerformanceClient.flushMeasurements

removePerformanceCallback(string)

Removes a callback registered with addPerformanceCallback.

function removePerformanceCallback(callbackId: string): boolean

Parameters

callbackId

string

Returns

boolean

Inherited From PerformanceClient.removePerformanceCallback