BrowserPerformanceClient class
- Extends
-
PerformanceClient
Constructors
Browser |
Methods
generate |
|
start |
Starts measuring performance for a given operation. Returns a function that should be used to end the measurement. Also captures browser page visibilityState. |
start |
Inherited Methods
add |
Registers a callback function to receive performance events. |
add |
Saves extra information to be emitted when the measurements are flushed |
discard |
Removes measurements for a given correlation id. |
emit |
Emits events to all registered callbacks. |
end |
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. |
flush |
Gathers and emits performance events for measurements taked for the given top-level API and correlation ID. |
remove |
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