Skip to content

Make eventName of type string for BrowserPerformanceClient and PerformanceClient #6386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Make `eventName` of type string for `BrowserPerformanceClient` and `PerformanceClient` #6386",
"packageName": "@azure/msal-browser",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Make `eventName` of type string for `BrowserPerformanceClient` and `PerformanceClient` #6386",
"packageName": "@azure/msal-common",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 2 additions & 0 deletions lib/msal-browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export {
PerformanceCallbackFunction,
PerformanceEvent,
PerformanceEvents,
// Telemetry
InProgressPerformanceEvent,
} from "@azure/msal-common";

export { version } from "./packageMetadata";
4 changes: 2 additions & 2 deletions lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class BrowserPerformanceClient
* @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
*/
startMeasurement(
measureName: PerformanceEvents,
measureName: string,
correlationId?: string
): InProgressPerformanceEvent {
// Capture page visibilityState and then invoke start/end measurement
Expand Down Expand Up @@ -195,7 +195,7 @@ export class BrowserPerformanceClient
* @returns
*/
addQueueMeasurement(
eventName: PerformanceEvents,
eventName: string,
correlationId?: string,
queueTime?: number,
manuallyCompleted?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License.
*/

import { PerformanceEvent, PerformanceEvents } from "./PerformanceEvent";
import { PerformanceEvent } from "./PerformanceEvent";
import { IPerformanceMeasurement } from "./IPerformanceMeasurement";

export type PerformanceCallbackFunction = (events: PerformanceEvent[]) => void;
Expand Down Expand Up @@ -42,12 +42,12 @@ export interface IPerformanceClient {
generateId(): string;
calculateQueuedTime(preQueueTime: number, currentTime: number): number;
addQueueMeasurement(
eventName: PerformanceEvents,
eventName: string,
correlationId?: string,
queueTime?: number,
manuallyCompleted?: boolean
): void;
setPreQueueTime(eventName: PerformanceEvents, correlationId?: string): void;
setPreQueueTime(eventName: string, correlationId?: string): void;
}

/**
Expand All @@ -57,7 +57,7 @@ export type QueueMeasurement = {
/**
* Name of performance event
*/
eventName: PerformanceEvents;
eventName: string;

/**
* Time spent in JS queue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
* @param {string} correlationId
* @returns {number}
*/
getPreQueueTime(
eventName: PerformanceEvents,
correlationId: string
): number | void {
getPreQueueTime(eventName: string, correlationId: string): number | void {
const preQueueEvent: PreQueueEvent | undefined =
this.preQueueTimeByCorrelationId.get(correlationId);

Expand Down Expand Up @@ -204,7 +201,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
* @returns
*/
addQueueMeasurement(
eventName: PerformanceEvents,
eventName: string,
correlationId?: string,
queueTime?: number,
manuallyCompleted?: boolean
Expand Down