diff --git a/change/@azure-msal-browser-9bbbc643-287b-473e-8d2c-2248c7e70dd0.json b/change/@azure-msal-browser-9bbbc643-287b-473e-8d2c-2248c7e70dd0.json new file mode 100644 index 0000000000..1b9abde857 --- /dev/null +++ b/change/@azure-msal-browser-9bbbc643-287b-473e-8d2c-2248c7e70dd0.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Remove queue time instrumentation #7747", + "packageName": "@azure/msal-browser", + "email": "kshabelko@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@azure-msal-common-805324f3-d57a-4797-a102-ef67c6321420.json b/change/@azure-msal-common-805324f3-d57a-4797-a102-ef67c6321420.json new file mode 100644 index 0000000000..20e5350b51 --- /dev/null +++ b/change/@azure-msal-common-805324f3-d57a-4797-a102-ef67c6321420.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "Remove queue time instrumentation #7747", + "packageName": "@azure/msal-common", + "email": "kshabelko@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/lib/msal-browser/apiReview/msal-browser.api.md b/lib/msal-browser/apiReview/msal-browser.api.md index 355eecb7d8..50e4f9750b 100644 --- a/lib/msal-browser/apiReview/msal-browser.api.md +++ b/lib/msal-browser/apiReview/msal-browser.api.md @@ -291,24 +291,11 @@ export class BrowserConfigurationAuthError extends AuthError { // @public (undocumented) export class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient { constructor(configuration: Configuration, intFields?: Set, abbreviations?: Map); - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void; // (undocumented) generateId(): string; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - setPreQueueTime(eventName: PerformanceEvents, correlationId?: string): void; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets. // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' // Warning: (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag @@ -1491,7 +1478,7 @@ export type WrapperSKU = (typeof WrapperSKU)[keyof typeof WrapperSKU]; // src/cache/LocalStorage.ts:296:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/cache/LocalStorage.ts:354:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/cache/LocalStorage.ts:385:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/config/Configuration.ts:256:5 - (ae-forgotten-export) The symbol "InternalAuthOptions" needs to be exported by the entry point index.d.ts +// src/config/Configuration.ts:231:5 - (ae-forgotten-export) The symbol "InternalAuthOptions" needs to be exported by the entry point index.d.ts // src/event/EventHandler.ts:113:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/event/EventHandler.ts:139:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/index.ts:8:12 - (tsdoc-characters-after-block-tag) The token "@azure" looks like a TSDoc tag but contains an invalid character "/"; if it is not a tag, use a backslash to escape the "@" diff --git a/lib/msal-browser/src/cache/BrowserCacheManager.ts b/lib/msal-browser/src/cache/BrowserCacheManager.ts index 7014364435..8537aa5814 100644 --- a/lib/msal-browser/src/cache/BrowserCacheManager.ts +++ b/lib/msal-browser/src/cache/BrowserCacheManager.ts @@ -1020,15 +1020,7 @@ export class BrowserCacheManager extends CacheManager { * @param correlationId {string} correlation id * @returns */ - async clearTokensAndKeysWithClaims( - performanceClient: IPerformanceClient, - correlationId: string - ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.ClearTokensAndKeysWithClaims, - correlationId - ); - + async clearTokensAndKeysWithClaims(): Promise { const tokenKeys = this.getTokenKeys(); const removedAccessTokens: Array> = []; diff --git a/lib/msal-browser/src/controllers/StandardController.ts b/lib/msal-browser/src/controllers/StandardController.ts index 67987ded3d..d6a7faff98 100644 --- a/lib/msal-browser/src/controllers/StandardController.ts +++ b/lib/msal-browser/src/controllers/StandardController.ts @@ -371,7 +371,7 @@ export class StandardController implements IController { this.logger, this.performanceClient, initCorrelationId - )(this.performanceClient, initCorrelationId); + )(); } if ( @@ -1242,10 +1242,6 @@ export class StandardController implements IController { commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenFromCache, - commonRequest.correlationId - ); switch (cacheLookupPolicy) { case CacheLookupPolicy.Default: case CacheLookupPolicy.AccessToken: @@ -1277,10 +1273,6 @@ export class StandardController implements IController { commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenByRefreshToken, - commonRequest.correlationId - ); switch (cacheLookupPolicy) { case CacheLookupPolicy.Default: case CacheLookupPolicy.AccessTokenAndRefreshToken: @@ -1312,11 +1304,6 @@ export class StandardController implements IController { protected async acquireTokenBySilentIframe( request: CommonSilentFlowRequest ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenBySilentIframe, - request.correlationId - ); - const silentIframeClient = this.createSilentIframeClient( request.correlationId ); @@ -2039,11 +2026,6 @@ export class StandardController implements IController { ): Promise { const trackPageVisibility = () => this.trackPageVisibility(request.correlationId); - this.performanceClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenSilentAsync, - request.correlationId - ); - this.eventHandler.emitEvent( EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, diff --git a/lib/msal-browser/src/crypto/BrowserCrypto.ts b/lib/msal-browser/src/crypto/BrowserCrypto.ts index a49efbaf2d..38760f5cbc 100644 --- a/lib/msal-browser/src/crypto/BrowserCrypto.ts +++ b/lib/msal-browser/src/crypto/BrowserCrypto.ts @@ -7,10 +7,6 @@ import { createBrowserAuthError, BrowserAuthErrorCodes, } from "../error/BrowserAuthError.js"; -import { - IPerformanceClient, - PerformanceEvents, -} from "@azure/msal-common/browser"; import { KEY_FORMAT_JWK } from "../utils/BrowserConstants.js"; import { base64Encode, urlEncodeArr } from "../encode/Base64Encode.js"; import { base64Decode, base64DecToArr } from "../encode/Base64Decode.js"; @@ -83,15 +79,7 @@ export function validateCryptoAvailable( * @param performanceClient {?IPerformanceClient} * @param correlationId {?string} correlation id */ -export async function sha256Digest( - dataString: string, - performanceClient?: IPerformanceClient, - correlationId?: string -): Promise { - performanceClient?.addQueueMeasurement( - PerformanceEvents.Sha256Digest, - correlationId - ); +export async function sha256Digest(dataString: string): Promise { const encoder = new TextEncoder(); const data = encoder.encode(dataString); return window.crypto.subtle.digest( diff --git a/lib/msal-browser/src/crypto/PkceGenerator.ts b/lib/msal-browser/src/crypto/PkceGenerator.ts index 1c0a9a3e34..0de2f27a52 100644 --- a/lib/msal-browser/src/crypto/PkceGenerator.ts +++ b/lib/msal-browser/src/crypto/PkceGenerator.ts @@ -33,10 +33,6 @@ export async function generatePkceCodes( logger: Logger, correlationId: string ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.GeneratePkceCodes, - correlationId - ); const codeVerifier = invoke( generateCodeVerifier, PerformanceEvents.GenerateCodeVerifier, @@ -94,10 +90,6 @@ async function generateCodeChallengeFromVerifier( logger: Logger, correlationId: string ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.GenerateCodeChallengeFromVerifier, - correlationId - ); try { // hashed verifier const pkceHashedCodeVerifier = await invokeAsync( @@ -106,7 +98,7 @@ async function generateCodeChallengeFromVerifier( logger, performanceClient, correlationId - )(pkceCodeVerifier, performanceClient, correlationId); + )(pkceCodeVerifier); // encode hash as base64 return urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier)); } catch (e) { diff --git a/lib/msal-browser/src/interaction_client/BaseInteractionClient.ts b/lib/msal-browser/src/interaction_client/BaseInteractionClient.ts index 51bccf5055..f9fa3101d4 100644 --- a/lib/msal-browser/src/interaction_client/BaseInteractionClient.ts +++ b/lib/msal-browser/src/interaction_client/BaseInteractionClient.ts @@ -195,10 +195,6 @@ export abstract class BaseInteractionClient { ? params.requestExtraQueryParameters["instance_aware"] : undefined; - this.performanceClient.addQueueMeasurement( - PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, - this.correlationId - ); const authorityOptions: AuthorityOptions = { protocolMode: this.config.system.protocolMode, OIDCOptions: this.config.auth.OIDCOptions, diff --git a/lib/msal-browser/src/interaction_client/NativeInteractionClient.ts b/lib/msal-browser/src/interaction_client/NativeInteractionClient.ts index a51eae8545..acd99662d0 100644 --- a/lib/msal-browser/src/interaction_client/NativeInteractionClient.ts +++ b/lib/msal-browser/src/interaction_client/NativeInteractionClient.ts @@ -162,10 +162,6 @@ export class NativeInteractionClient extends BaseInteractionClient { request: PopupRequest | SilentRequest | SsoSilentRequest, cacheLookupPolicy?: CacheLookupPolicy ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.NativeInteractionClientAcquireToken, - request.correlationId - ); this.logger.trace("NativeInteractionClient - acquireToken called."); // start the perf measurement diff --git a/lib/msal-browser/src/interaction_client/SilentCacheClient.ts b/lib/msal-browser/src/interaction_client/SilentCacheClient.ts index 8f3f606a73..dee5809724 100644 --- a/lib/msal-browser/src/interaction_client/SilentCacheClient.ts +++ b/lib/msal-browser/src/interaction_client/SilentCacheClient.ts @@ -26,10 +26,6 @@ export class SilentCacheClient extends StandardInteractionClient { async acquireToken( silentRequest: CommonSilentFlowRequest ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.SilentCacheClientAcquireToken, - silentRequest.correlationId - ); // Telemetry manager only used to increment cacheHits here const serverTelemetryManager = this.initializeServerTelemetryManager( ApiId.acquireTokenSilent_silentFlow diff --git a/lib/msal-browser/src/interaction_client/SilentIframeClient.ts b/lib/msal-browser/src/interaction_client/SilentIframeClient.ts index a8a130680d..1212b9c865 100644 --- a/lib/msal-browser/src/interaction_client/SilentIframeClient.ts +++ b/lib/msal-browser/src/interaction_client/SilentIframeClient.ts @@ -83,10 +83,6 @@ export class SilentIframeClient extends StandardInteractionClient { async acquireToken( request: SsoSilentRequest ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.SilentIframeClientAcquireToken, - request.correlationId - ); // Check that we have some SSO data if ( !request.loginHint && @@ -321,10 +317,6 @@ export class SilentIframeClient extends StandardInteractionClient { request: CommonAuthorizationUrlRequest ): Promise { const correlationId = request.correlationId; - this.performanceClient.addQueueMeasurement( - PerformanceEvents.SilentIframeClientTokenHelper, - correlationId - ); const pkceCodes = await invokeAsync( generatePkceCodes, PerformanceEvents.GeneratePkceCodes, diff --git a/lib/msal-browser/src/interaction_client/SilentRefreshClient.ts b/lib/msal-browser/src/interaction_client/SilentRefreshClient.ts index 3db3c5ee69..ee5f00dbc2 100644 --- a/lib/msal-browser/src/interaction_client/SilentRefreshClient.ts +++ b/lib/msal-browser/src/interaction_client/SilentRefreshClient.ts @@ -31,11 +31,6 @@ export class SilentRefreshClient extends StandardInteractionClient { async acquireToken( request: CommonSilentFlowRequest ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.SilentRefreshClientAcquireToken, - request.correlationId - ); - const baseRequest = await invokeAsync( initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, diff --git a/lib/msal-browser/src/interaction_client/StandardInteractionClient.ts b/lib/msal-browser/src/interaction_client/StandardInteractionClient.ts index 995d0adeee..95b68b42fa 100644 --- a/lib/msal-browser/src/interaction_client/StandardInteractionClient.ts +++ b/lib/msal-browser/src/interaction_client/StandardInteractionClient.ts @@ -183,10 +183,6 @@ export abstract class StandardInteractionClient extends BaseInteractionClient { requestExtraQueryParameters?: StringDict; account?: AccountInfo; }): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, - this.correlationId - ); // Create auth module. const clientConfig = await invokeAsync( this.getClientConfiguration.bind(this), @@ -227,10 +223,6 @@ export abstract class StandardInteractionClient extends BaseInteractionClient { account, } = params; - this.performanceClient.addQueueMeasurement( - PerformanceEvents.StandardInteractionClientGetClientConfiguration, - this.correlationId - ); const discoveredAuthority = await invokeAsync( this.getDiscoveredAuthority.bind(this), PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, @@ -290,11 +282,6 @@ export abstract class StandardInteractionClient extends BaseInteractionClient { request: RedirectRequest | PopupRequest | SsoSilentRequest, interactionType: InteractionType ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, - this.correlationId - ); - const redirectUri = this.getRedirectUri(request.redirectUri); const browserState: BrowserStateObject = { interactionType: interactionType, diff --git a/lib/msal-browser/src/interaction_handler/InteractionHandler.ts b/lib/msal-browser/src/interaction_handler/InteractionHandler.ts index 2b033625be..31598bedb7 100644 --- a/lib/msal-browser/src/interaction_handler/InteractionHandler.ts +++ b/lib/msal-browser/src/interaction_handler/InteractionHandler.ts @@ -58,11 +58,6 @@ export class InteractionHandler { response: AuthorizeResponse, request: CommonAuthorizationUrlRequest ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.HandleCodeResponse, - request.correlationId - ); - let authCodeResponse; try { authCodeResponse = AuthorizeProtocol.getAuthorizationCodePayload( @@ -105,10 +100,6 @@ export class InteractionHandler { request: CommonAuthorizationUrlRequest, validateNonce: boolean = true ): Promise { - this.performanceClient.addQueueMeasurement( - PerformanceEvents.HandleCodeResponseFromServer, - request.correlationId - ); this.logger.trace( "InteractionHandler.handleCodeResponseFromServer called" ); diff --git a/lib/msal-browser/src/interaction_handler/SilentHandler.ts b/lib/msal-browser/src/interaction_handler/SilentHandler.ts index ea01fba46a..fdf7250683 100644 --- a/lib/msal-browser/src/interaction_handler/SilentHandler.ts +++ b/lib/msal-browser/src/interaction_handler/SilentHandler.ts @@ -33,11 +33,6 @@ export async function initiateCodeRequest( logger: Logger, correlationId: string ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.SilentHandlerInitiateAuthRequest, - correlationId - ); - if (!requestUrl) { // Throw error if request URL is empty. logger.info("Navigate url is empty"); @@ -90,11 +85,6 @@ export async function monitorIframeForHash( correlationId: string, responseType: ResponseMode ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.SilentHandlerMonitorIframeForHash, - correlationId - ); - return new Promise((resolve, reject) => { if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) { logger.warning( diff --git a/lib/msal-browser/src/protocol/Authorize.ts b/lib/msal-browser/src/protocol/Authorize.ts index 626314cefa..3494b4a33b 100644 --- a/lib/msal-browser/src/protocol/Authorize.ts +++ b/lib/msal-browser/src/protocol/Authorize.ts @@ -451,8 +451,7 @@ export async function handleResponseEAR( new CryptoOps(logger, performanceClient), logger, null, - null, - performanceClient + null ); // Validate response. This function throws a server error if an error is returned by the server. diff --git a/lib/msal-browser/src/request/RequestHelpers.ts b/lib/msal-browser/src/request/RequestHelpers.ts index b37697f28b..ccd1d38ff1 100644 --- a/lib/msal-browser/src/request/RequestHelpers.ts +++ b/lib/msal-browser/src/request/RequestHelpers.ts @@ -30,10 +30,6 @@ export async function initializeBaseRequest( performanceClient: IPerformanceClient, logger: Logger ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.InitializeBaseRequest, - request.correlationId - ); const authority = request.authority || config.auth.authority; const scopes = [...((request && request.scopes) || [])]; @@ -91,11 +87,6 @@ export async function initializeSilentRequest( performanceClient: IPerformanceClient, logger: Logger ): Promise { - performanceClient.addQueueMeasurement( - PerformanceEvents.InitializeSilentRequest, - request.correlationId - ); - const baseRequest = await invokeAsync( initializeBaseRequest, PerformanceEvents.InitializeBaseRequest, diff --git a/lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts b/lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts index c7429c002b..19b4e9f2f4 100644 --- a/lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts +++ b/lib/msal-browser/src/telemetry/BrowserPerformanceClient.ts @@ -10,8 +10,6 @@ import { Logger, PerformanceClient, PerformanceEvent, - PerformanceEvents, - PreQueueEvent, SubMeasurement, } from "@azure/msal-common/browser"; import { Configuration } from "../config/Configuration.js"; @@ -192,98 +190,4 @@ export class BrowserPerformanceClient }, }; } - - /** - * Adds pre-queue time to preQueueTimeByCorrelationId map. - * @param {PerformanceEvents} eventName - * @param {?string} correlationId - * @returns - */ - setPreQueueTime( - eventName: PerformanceEvents, - correlationId?: string - ): void { - if (!supportsBrowserPerformanceNow()) { - this.logger.trace( - `BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for ${eventName}` - ); - return; - } - - if (!correlationId) { - this.logger.trace( - `BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to set telemetry queue time` - ); - return; - } - - const preQueueEvent: PreQueueEvent | undefined = - this.preQueueTimeByCorrelationId.get(correlationId); - /** - * Manually complete queue measurement if there is an incomplete pre-queue event. - * Incomplete pre-queue events are instrumentation bugs that should be fixed. - */ - if (preQueueEvent) { - this.logger.trace( - `BrowserPerformanceClient: Incomplete pre-queue ${preQueueEvent.name} found`, - correlationId - ); - this.addQueueMeasurement( - preQueueEvent.name, - correlationId, - undefined, - true - ); - } - this.preQueueTimeByCorrelationId.set(correlationId, { - name: eventName, - time: window.performance.now(), - }); - } - - /** - * Calculates and adds queue time measurement for given performance event. - * - * @param {PerformanceEvents} eventName - * @param {?string} correlationId - * @param {?number} queueTime - * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements - * @returns - */ - addQueueMeasurement( - eventName: string, - correlationId?: string, - queueTime?: number, - manuallyCompleted?: boolean - ): void { - if (!supportsBrowserPerformanceNow()) { - this.logger.trace( - `BrowserPerformanceClient: window performance API not available, unable to add queue measurement for ${eventName}` - ); - return; - } - - if (!correlationId) { - this.logger.trace( - `BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to add queue measurement` - ); - return; - } - - const preQueueTime = super.getPreQueueTime(eventName, correlationId); - if (!preQueueTime) { - return; - } - - const currentTime = window.performance.now(); - const resQueueTime = - queueTime || super.calculateQueuedTime(preQueueTime, currentTime); - - return super.addQueueMeasurement( - eventName, - correlationId, - resQueueTime, - manuallyCompleted - ); - } } diff --git a/lib/msal-browser/test/cache/BrowserCacheManager.spec.ts b/lib/msal-browser/test/cache/BrowserCacheManager.spec.ts index 55bad7f5a6..89dadd250d 100644 --- a/lib/msal-browser/test/cache/BrowserCacheManager.spec.ts +++ b/lib/msal-browser/test/cache/BrowserCacheManager.spec.ts @@ -908,14 +908,8 @@ describe("BrowserCacheManager tests", () => { ) ).toEqual(testAT4); - browserSessionStorage.clearTokensAndKeysWithClaims( - getDefaultPerformanceClient(), - "test-correlation-id" - ); - browserLocalStorage.clearTokensAndKeysWithClaims( - getDefaultPerformanceClient(), - "test-correlation-id" - ); + browserSessionStorage.clearTokensAndKeysWithClaims(); + browserLocalStorage.clearTokensAndKeysWithClaims(); expect( browserSessionStorage.getAccessTokenCredential( diff --git a/lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts b/lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts index d75b092a7b..86952d4383 100644 --- a/lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts +++ b/lib/msal-browser/test/interaction_handler/SilentHandler.spec.ts @@ -38,9 +38,6 @@ describe("SilentHandler.ts Unit Tests", () => { addPerformanceCallback: jest.fn(), emitEvents: jest.fn(), generateId: jest.fn(), - calculateQueuedTime: jest.fn(), - addQueueMeasurement: jest.fn(), - setPreQueueTime: jest.fn(), addFields: jest.fn(), incrementFields: jest.fn(), }; diff --git a/lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts b/lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts index 89bfafafbc..61e52392cc 100644 --- a/lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts +++ b/lib/msal-browser/test/telemetry/BrowserPerformanceClient.spec.ts @@ -21,24 +21,6 @@ describe("BrowserPerformanceClient.ts", () => { jest.restoreAllMocks(); }); - it("sets pre-queue time", () => { - const browserPerfClient = new BrowserPerformanceClient(testAppConfig); - const eventName = PerformanceEvents.AcquireTokenSilent; - const correlationId = "test-correlation-id"; - - jest.spyOn(window.performance, "now").mockReturnValue(perfTimeNow); - - browserPerfClient.setPreQueueTime(eventName, correlationId); - // @ts-ignore - expect( - browserPerfClient.getPreQueueTime(eventName, correlationId) - ).toEqual(perfTimeNow); - expect( - // @ts-ignore - browserPerfClient.preQueueTimeByCorrelationId.get(correlationId) - ).toEqual({ name: eventName, time: perfTimeNow }); - }); - describe("generateId", () => { it("returns a string", () => { const browserPerfClient = new BrowserPerformanceClient( @@ -93,60 +75,4 @@ describe("BrowserPerformanceClient.ts", () => { expect(result?.endPageVisibility).toBe("visible"); }); }); - - describe("setPreQueueTime", () => { - it("setPreQueueTime returns if window.performance is not available", () => { - const addQueueMeasurementSpy = jest.spyOn( - BrowserPerformanceClient.prototype, - "addQueueMeasurement" - ); - - const browserPerfClient = new BrowserPerformanceClient( - testAppConfig - ); - const correlationId = "dummy-correlation-id"; - // @ts-ignore - browserPerfClient.preQueueTimeByCorrelationId.set(correlationId, { - name: PerformanceEvents.AcquireTokenSilent, - time: 12345, - }); - - jest.spyOn(window, "performance", "get") // @ts-ignore - .mockReturnValue(undefined); - - browserPerfClient.setPreQueueTime( - PerformanceEvents.AcquireTokenSilent, - "dummy-correlation-id" - ); - expect(addQueueMeasurementSpy).toBeCalledTimes(0); - }); - - it("setPreQueueTime adds queue measurement if window.performance available", () => { - // @ts-ignore - jest.spyOn(window, "performance", "get").mockReturnValue({ - now: jest.fn(), - }); - jest.spyOn(window.performance, "now").mockReturnValue(perfTimeNow); - const addQueueMeasurementSpy = jest.spyOn( - BrowserPerformanceClient.prototype, - "addQueueMeasurement" - ); - - const browserPerfClient = new BrowserPerformanceClient( - testAppConfig - ); - const correlationId = "dummy-correlation-id"; - // @ts-ignore - browserPerfClient.preQueueTimeByCorrelationId.set(correlationId, { - name: PerformanceEvents.AcquireTokenSilent, - time: 12345, - }); - - browserPerfClient.setPreQueueTime( - PerformanceEvents.AcquireTokenSilent, - "dummy-correlation-id" - ); - expect(addQueueMeasurementSpy).toBeCalledTimes(1); - }); - }); }); diff --git a/lib/msal-common/apiReview/msal-common.api.md b/lib/msal-common/apiReview/msal-common.api.md index cca1651662..21e31c1cbd 100644 --- a/lib/msal-common/apiReview/msal-common.api.md +++ b/lib/msal-common/apiReview/msal-common.api.md @@ -892,7 +892,7 @@ export abstract class BaseClient { // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record, thumbprint: RequestThumbprint, correlationId: string, queuedEvent?: string): Promise>; + protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record, thumbprint: RequestThumbprint, correlationId: string): Promise>; // (undocumented) logger: Logger; // (undocumented) @@ -2528,10 +2528,6 @@ export interface IPerformanceClient { // (undocumented) addPerformanceCallback(callback: PerformanceCallbackFunction): string; // (undocumented) - addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void; - // (undocumented) - calculateQueuedTime(preQueueTime: number, currentTime: number): number; - // (undocumented) discardMeasurements(correlationId: string): void; // (undocumented) emitEvents(events: PerformanceEvent[], correlationId: string): void; @@ -2546,8 +2542,6 @@ export interface IPerformanceClient { // (undocumented) removePerformanceCallback(callbackId: string): boolean; // (undocumented) - setPreQueueTime(eventName: string, correlationId?: string): void; - // (undocumented) startMeasurement(measureName: string, correlationId?: string): InProgressPerformanceEvent; } @@ -3052,14 +3046,6 @@ export abstract class PerformanceClient implements IPerformanceClient { // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" addPerformanceCallback(callback: PerformanceCallbackFunction): string; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void; // (undocumented) protected applicationTelemetry: ApplicationTelemetry; // (undocumented) @@ -3068,13 +3054,6 @@ export abstract class PerformanceClient implements IPerformanceClient { // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' protected cacheEventByCorrelationId(event: PerformanceEvent): void; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - calculateQueuedTime(preQueueTime: number, currentTime: number): number; // (undocumented) protected callbacks: Map; // (undocumented) @@ -3113,13 +3092,6 @@ export abstract class PerformanceClient implements IPerformanceClient { // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - getPreQueueTime(eventName: string, correlationId: string): number | void; - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' incrementFields(fields: { [key: string]: number | undefined; }, correlationId: string): void; @@ -3131,31 +3103,11 @@ export abstract class PerformanceClient implements IPerformanceClient { protected libraryVersion: string; // (undocumented) protected logger: Logger; - // Warning: (tsdoc-undefined-tag) The TSDoc tag "@protected" is not defined in this configuration - // Warning: (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag - // Warning: (tsdoc-html-tag-missing-greater-than) The HTML tag has invalid syntax: Expecting an attribute or ">" or "/>" - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - // Warning: (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration - protected preQueueTimeByCorrelationId: Map; - // Warning: (tsdoc-undefined-tag) The TSDoc tag "@protected" is not defined in this configuration - // Warning: (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag - // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag - // Warning: (tsdoc-html-tag-missing-greater-than) The HTML tag has invalid syntax: Expecting an attribute or ">" or "/>" - // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" - // Warning: (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration - protected queueMeasurements: Map>; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' // Warning: (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // Warning: (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" removePerformanceCallback(callbackId: string): boolean; - // Warning: (tsdoc-undefined-tag) The TSDoc tag "@abstract" is not defined in this configuration - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen - // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' - abstract setPreQueueTime(eventName: PerformanceEvents, correlationId?: string): void; // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // Warning: (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' // Warning: (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen @@ -3195,13 +3147,10 @@ export type PerformanceEvent = { requestId?: string; cacheLookupPolicy?: number | undefined; cacheOutcome?: number; - queuedTimeMs?: number; incompleteSubMeasurements?: Map; visibilityChangeCount?: number; incompleteSubsCount?: number; awaitIframeCorrelationId?: string; - queuedCount?: number; - queuedManuallyCompletedCount?: number; idTokenSize?: number; accessTokenSize?: number; refreshTokenSize?: number | undefined; @@ -3442,16 +3391,6 @@ const POST_LOGOUT_URI = "post_logout_redirect_uri"; // @public (undocumented) const postRequestFailed = "post_request_failed"; -// Warning: (ae-missing-release-tag) "PreQueueEvent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PreQueueEvent { - // (undocumented) - name: PerformanceEvents; - // (undocumented) - time: number; -} - // Warning: (ae-missing-release-tag) "PROMPT" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3497,15 +3436,6 @@ export class ProtocolUtils { static setRequestState(cryptoObj: ICrypto, userState?: string, meta?: Record): string; } -// Warning: (ae-missing-release-tag) "QueueMeasurement" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type QueueMeasurement = { - eventName: string; - queueTime: number; - manuallyCompleted?: boolean; -}; - // Warning: (ae-missing-release-tag) "REDIRECT_URI" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -3659,7 +3589,7 @@ const RESPONSE_TYPE = "response_type"; // // @internal export class ResponseHandler { - constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null, performanceClient?: IPerformanceClient); + constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null); // Warning: (tsdoc-undefined-tag) The TSDoc tag "@AuthenticationResult" is not defined in this configuration // Warning: (tsdoc-undefined-tag) The TSDoc tag "@CacheRecord" is not defined in this configuration // Warning: (tsdoc-undefined-tag) The TSDoc tag "@IdToken" is not defined in this configuration @@ -3965,12 +3895,8 @@ export class StubPerformanceClient implements IPerformanceClient { // (undocumented) addPerformanceCallback(): string; // (undocumented) - addQueueMeasurement(): void; - // (undocumented) cacheEventByCorrelationId(): void; // (undocumented) - calculateQueuedTime(): number; - // (undocumented) discardMeasurements(): void; // (undocumented) emitEvents(): void; @@ -3983,8 +3909,6 @@ export class StubPerformanceClient implements IPerformanceClient { // (undocumented) removePerformanceCallback(): boolean; // (undocumented) - setPreQueueTime(): void; - // (undocumented) startMeasurement(measureName: string, correlationId?: string | undefined): InProgressPerformanceEvent; } @@ -4359,15 +4283,15 @@ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability"; // src/authority/Authority.ts:305:8 - (tsdoc-undefined-tag) The TSDoc tag "@private" is not defined in this configuration // src/authority/Authority.ts:320:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/authority/Authority.ts:328:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:469:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:470:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:471:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:500:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:584:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:654:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:692:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:810:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/authority/Authority.ts:994:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:464:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:465:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:466:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:495:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:574:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:644:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:682:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:790:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/authority/Authority.ts:970:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/authority/AuthorityOptions.ts:25:5 - (ae-forgotten-export) The symbol "CloudInstanceDiscoveryResponse" needs to be exported by the entry point index.d.ts // src/cache/CacheManager.ts:290:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/cache/CacheManager.ts:291:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen @@ -4407,29 +4331,29 @@ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability"; // src/cache/CacheManager.ts:1827:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/cache/utils/CacheTypes.ts:94:53 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag // src/cache/utils/CacheTypes.ts:94:43 - (tsdoc-malformed-html-name) Invalid HTML element: An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens -// src/client/AuthorizationCodeClient.ts:158:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/AuthorizationCodeClient.ts:159:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/AuthorizationCodeClient.ts:228:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/AuthorizationCodeClient.ts:460:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/RefreshTokenClient.ts:194:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/RefreshTokenClient.ts:287:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/RefreshTokenClient.ts:288:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/RefreshTokenClient.ts:339:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/client/SilentFlowClient.ts:172:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/AuthorizationCodeClient.ts:152:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/AuthorizationCodeClient.ts:153:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/AuthorizationCodeClient.ts:210:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/AuthorizationCodeClient.ts:437:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/RefreshTokenClient.ts:183:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/RefreshTokenClient.ts:271:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/RefreshTokenClient.ts:272:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/RefreshTokenClient.ts:311:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/client/SilentFlowClient.ts:168:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen // src/config/ClientConfiguration.ts:50:5 - (ae-forgotten-export) The symbol "ClientCredentials" needs to be exported by the entry point index.d.ts // src/config/ClientConfiguration.ts:52:5 - (ae-forgotten-export) The symbol "TelemetryOptions" needs to be exported by the entry point index.d.ts // src/index.ts:8:12 - (tsdoc-characters-after-block-tag) The token "@azure" looks like a TSDoc tag but contains an invalid character "/"; if it is not a tag, use a backslash to escape the "@" // src/index.ts:8:4 - (tsdoc-undefined-tag) The TSDoc tag "@module" is not defined in this configuration // src/request/AuthenticationHeaderParser.ts:74:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/response/ResponseHandler.ts:336:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/response/ResponseHandler.ts:337:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/response/ResponseHandler.ts:338:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/telemetry/performance/PerformanceClient.ts:897:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/telemetry/performance/PerformanceClient.ts:897:15 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' -// src/telemetry/performance/PerformanceClient.ts:909:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen -// src/telemetry/performance/PerformanceClient.ts:909:27 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' -// src/telemetry/performance/PerformanceClient.ts:910:24 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceClient.ts:910:17 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/response/ResponseHandler.ts:326:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/response/ResponseHandler.ts:327:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/response/ResponseHandler.ts:328:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/telemetry/performance/PerformanceClient.ts:692:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/telemetry/performance/PerformanceClient.ts:692:15 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' +// src/telemetry/performance/PerformanceClient.ts:704:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen +// src/telemetry/performance/PerformanceClient.ts:704:27 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}' +// src/telemetry/performance/PerformanceClient.ts:705:24 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceClient.ts:705:17 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // src/telemetry/performance/PerformanceEvent.ts:589:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // src/telemetry/performance/PerformanceEvent.ts:589:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // src/telemetry/performance/PerformanceEvent.ts:589:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration @@ -4491,32 +4415,23 @@ const X_MS_LIB_CAPABILITY = "x-ms-lib-capability"; // src/telemetry/performance/PerformanceEvent.ts:729:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag // src/telemetry/performance/PerformanceEvent.ts:729:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" // src/telemetry/performance/PerformanceEvent.ts:729:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:736:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:736:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:736:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:755:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:755:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:755:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:761:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:761:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:761:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:768:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:768:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:768:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:776:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:776:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:776:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:785:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:785:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:785:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:793:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:793:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:793:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:800:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:800:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:800:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration -// src/telemetry/performance/PerformanceEvent.ts:870:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag -// src/telemetry/performance/PerformanceEvent.ts:870:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" -// src/telemetry/performance/PerformanceEvent.ts:870:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:749:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:749:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:749:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:757:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:757:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:757:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:766:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:766:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:766:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:774:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:774:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:774:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:781:22 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:781:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:781:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration +// src/telemetry/performance/PerformanceEvent.ts:851:21 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag +// src/telemetry/performance/PerformanceEvent.ts:851:14 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@" +// src/telemetry/performance/PerformanceEvent.ts:851:8 - (tsdoc-undefined-tag) The TSDoc tag "@type" is not defined in this configuration ``` diff --git a/lib/msal-common/src/authority/Authority.ts b/lib/msal-common/src/authority/Authority.ts index f4d590ee78..d6280ddaa5 100644 --- a/lib/msal-common/src/authority/Authority.ts +++ b/lib/msal-common/src/authority/Authority.ts @@ -398,11 +398,6 @@ export class Authority { * and the /authorize, /token and logout endpoints. */ public async resolveEndpointsAsync(): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityResolveEndpointsAsync, - this.correlationId - ); - const metadataEntity = this.getCurrentMetadataEntity(); const cloudDiscoverySource = await invokeAsync( @@ -502,11 +497,6 @@ export class Authority { private async updateEndpointMetadata( metadataEntity: AuthorityMetadataEntity ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityUpdateEndpointMetadata, - this.correlationId - ); - const localMetadata = this.updateEndpointMetadataFromLocalSources(metadataEntity); @@ -692,11 +682,6 @@ export class Authority { * @param hasHardcodedMetadata boolean */ private async getEndpointMetadataFromNetwork(): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, - this.correlationId - ); - const options: ImdsOptions = {}; /* @@ -751,11 +736,6 @@ export class Authority { private async updateMetadataWithRegionalInformation( metadata: OpenIdConfigResponse ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, - this.correlationId - ); - const userConfiguredAzureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion; @@ -813,10 +793,6 @@ export class Authority { private async updateCloudDiscoveryMetadata( metadataEntity: AuthorityMetadataEntity ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, - this.correlationId - ); const localMetadataSource = this.updateCloudDiscoveryMetadataFromLocalSources(metadataEntity); if (localMetadataSource) { @@ -994,10 +970,6 @@ export class Authority { * @param hasHardcodedMetadata boolean */ private async getCloudDiscoveryMetadataFromNetwork(): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, - this.correlationId - ); const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`; const options: ImdsOptions = {}; diff --git a/lib/msal-common/src/authority/AuthorityFactory.ts b/lib/msal-common/src/authority/AuthorityFactory.ts index abeb099e72..0531b83809 100644 --- a/lib/msal-common/src/authority/AuthorityFactory.ts +++ b/lib/msal-common/src/authority/AuthorityFactory.ts @@ -36,10 +36,6 @@ export async function createDiscoveredInstance( correlationId: string, performanceClient?: IPerformanceClient ): Promise { - performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, - correlationId - ); const authorityUriFinal = Authority.transformCIAMAuthority( formatAuthorityUri(authorityUri) ); diff --git a/lib/msal-common/src/authority/RegionDiscovery.ts b/lib/msal-common/src/authority/RegionDiscovery.ts index 39af480bc4..e5939c51da 100644 --- a/lib/msal-common/src/authority/RegionDiscovery.ts +++ b/lib/msal-common/src/authority/RegionDiscovery.ts @@ -55,11 +55,6 @@ export class RegionDiscovery { environmentRegion: string | undefined, regionDiscoveryMetadata: RegionDiscoveryMetadata ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RegionDiscoveryDetectRegion, - this.correlationId - ); - // Initialize auto detected region with the region from the envrionment let autodetectedRegionName = environmentRegion; @@ -148,10 +143,6 @@ export class RegionDiscovery { version: string, options: ImdsOptions ): Promise> { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, - this.correlationId - ); return this.networkInterface.sendGetRequestAsync( `${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, @@ -167,10 +158,6 @@ export class RegionDiscovery { private async getCurrentVersion( options: ImdsOptions ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RegionDiscoveryGetCurrentVersion, - this.correlationId - ); try { const response = await this.networkInterface.sendGetRequestAsync( diff --git a/lib/msal-common/src/client/AuthorizationCodeClient.ts b/lib/msal-common/src/client/AuthorizationCodeClient.ts index ce00200387..21a6964280 100644 --- a/lib/msal-common/src/client/AuthorizationCodeClient.ts +++ b/lib/msal-common/src/client/AuthorizationCodeClient.ts @@ -77,11 +77,6 @@ export class AuthorizationCodeClient extends BaseClient { request: CommonAuthorizationCodeRequest, authCodePayload?: AuthorizationCodePayload ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthClientAcquireToken, - request.correlationId - ); - if (!request.code) { throw createClientAuthError( ClientAuthErrorCodes.requestCannotBeMade @@ -106,8 +101,7 @@ export class AuthorizationCodeClient extends BaseClient { this.cryptoUtils, this.logger, this.config.serializableCache, - this.config.persistencePlugin, - this.performanceClient + this.config.persistencePlugin ); // Validate response. This function throws a server error if an error is returned by the server. @@ -162,11 +156,6 @@ export class AuthorizationCodeClient extends BaseClient { authority: Authority, request: CommonAuthorizationCodeRequest ): Promise> { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthClientExecuteTokenRequest, - request.correlationId - ); - const queryParametersString = this.createTokenQueryParameters(request); const endpoint = UrlString.appendQueryString( authority.tokenEndpoint, @@ -213,14 +202,7 @@ export class AuthorizationCodeClient extends BaseClient { this.logger, this.performanceClient, request.correlationId - )( - endpoint, - requestBody, - headers, - thumbprint, - request.correlationId, - PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint - ); + )(endpoint, requestBody, headers, thumbprint, request.correlationId); } /** @@ -230,11 +212,6 @@ export class AuthorizationCodeClient extends BaseClient { private async createTokenRequestBody( request: CommonAuthorizationCodeRequest ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.AuthClientCreateTokenRequestBody, - request.correlationId - ); - const parameters = new Map(); RequestParameterBuilder.addClientId( diff --git a/lib/msal-common/src/client/BaseClient.ts b/lib/msal-common/src/client/BaseClient.ts index e60aa39943..b94c0a2ffd 100644 --- a/lib/msal-common/src/client/BaseClient.ts +++ b/lib/msal-common/src/client/BaseClient.ts @@ -144,16 +144,8 @@ export abstract class BaseClient { queryString: string, headers: Record, thumbprint: RequestThumbprint, - correlationId: string, - queuedEvent?: string + correlationId: string ): Promise> { - if (queuedEvent) { - this.performanceClient?.addQueueMeasurement( - queuedEvent, - correlationId - ); - } - const response = await this.sendPostRequest( thumbprint, @@ -257,10 +249,6 @@ export abstract class BaseClient { cloudInstanceHostname: string, correlationId: string ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.UpdateTokenEndpointAuthority, - correlationId - ); const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${this.authority.tenant}/`; const cloudInstanceAuthority = await createDiscoveredInstance( cloudInstanceAuthorityUri, diff --git a/lib/msal-common/src/client/RefreshTokenClient.ts b/lib/msal-common/src/client/RefreshTokenClient.ts index 1da926717e..0940106006 100644 --- a/lib/msal-common/src/client/RefreshTokenClient.ts +++ b/lib/msal-common/src/client/RefreshTokenClient.ts @@ -68,11 +68,6 @@ export class RefreshTokenClient extends BaseClient { public async acquireToken( request: CommonRefreshTokenRequest ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RefreshTokenClientAcquireToken, - request.correlationId - ); - const reqTimestamp = TimeUtils.nowSeconds(); const response = await invokeAsync( this.executeTokenRequest.bind(this), @@ -126,12 +121,6 @@ export class RefreshTokenClient extends BaseClient { ClientConfigurationErrorCodes.tokenRequestEmpty ); } - - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, - request.correlationId - ); - // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases if (!request.account) { throw createClientAuthError( @@ -197,11 +186,6 @@ export class RefreshTokenClient extends BaseClient { request: CommonSilentFlowRequest, foci: boolean ) { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, - request.correlationId - ); - // fetches family RT or application RT based on FOCI value const refreshToken = invoke( this.cacheManager.getRefreshToken.bind(this.cacheManager), @@ -291,11 +275,6 @@ export class RefreshTokenClient extends BaseClient { request: CommonRefreshTokenRequest, authority: Authority ): Promise> { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RefreshTokenClientExecuteTokenRequest, - request.correlationId - ); - const queryParametersString = this.createTokenQueryParameters(request); const endpoint = UrlString.appendQueryString( authority.tokenEndpoint, @@ -324,14 +303,7 @@ export class RefreshTokenClient extends BaseClient { this.logger, this.performanceClient, request.correlationId - )( - endpoint, - requestBody, - headers, - thumbprint, - request.correlationId, - PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint - ); + )(endpoint, requestBody, headers, thumbprint, request.correlationId); } /** @@ -341,11 +313,6 @@ export class RefreshTokenClient extends BaseClient { private async createTokenRequestBody( request: CommonRefreshTokenRequest ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, - request.correlationId - ); - const parameters = new Map(); RequestParameterBuilder.addClientId( diff --git a/lib/msal-common/src/client/SilentFlowClient.ts b/lib/msal-common/src/client/SilentFlowClient.ts index 0801c88ee0..7543d12056 100644 --- a/lib/msal-common/src/client/SilentFlowClient.ts +++ b/lib/msal-common/src/client/SilentFlowClient.ts @@ -39,10 +39,6 @@ export class SilentFlowClient extends BaseClient { async acquireCachedToken( request: CommonSilentFlowRequest ): Promise<[AuthenticationResult, CacheOutcome]> { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.SilentFlowClientAcquireCachedToken, - request.correlationId - ); let lastCacheOutcome: CacheOutcome = CacheOutcome.NOT_APPLICABLE; if ( @@ -175,10 +171,6 @@ export class SilentFlowClient extends BaseClient { cacheRecord: CacheRecord, request: CommonSilentFlowRequest ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord, - request.correlationId - ); let idTokenClaims: TokenClaims | undefined; if (cacheRecord.idToken) { idTokenClaims = extractTokenClaims( diff --git a/lib/msal-common/src/crypto/PopTokenGenerator.ts b/lib/msal-common/src/crypto/PopTokenGenerator.ts index e24378d0b6..cc20c292b2 100644 --- a/lib/msal-common/src/crypto/PopTokenGenerator.ts +++ b/lib/msal-common/src/crypto/PopTokenGenerator.ts @@ -54,11 +54,6 @@ export class PopTokenGenerator { request: SignedHttpRequestParameters, logger: Logger ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.PopTokenGenerateCnf, - request.correlationId - ); - const reqCnf = await invokeAsync( this.generateKid.bind(this), PerformanceEvents.PopTokenGenerateCnf, @@ -82,11 +77,6 @@ export class PopTokenGenerator { * @returns */ async generateKid(request: SignedHttpRequestParameters): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.PopTokenGenerateKid, - request.correlationId - ); - const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint( request ); diff --git a/lib/msal-common/src/exports-browser-only.ts b/lib/msal-common/src/exports-browser-only.ts index 4db5a6d8d9..b07a66738c 100644 --- a/lib/msal-common/src/exports-browser-only.ts +++ b/lib/msal-common/src/exports-browser-only.ts @@ -10,7 +10,6 @@ export { IPerformanceClient, PerformanceCallbackFunction, InProgressPerformanceEvent, - QueueMeasurement, } from "./telemetry/performance/IPerformanceClient.js"; export { IntFields, @@ -20,10 +19,7 @@ export { SubMeasurement, } from "./telemetry/performance/PerformanceEvent.js"; export { IPerformanceMeasurement } from "./telemetry/performance/IPerformanceMeasurement.js"; -export { - PerformanceClient, - PreQueueEvent, -} from "./telemetry/performance/PerformanceClient.js"; +export { PerformanceClient } from "./telemetry/performance/PerformanceClient.js"; export { StubPerformanceClient } from "./telemetry/performance/StubPerformanceClient.js"; export { PopTokenGenerator } from "./crypto/PopTokenGenerator.js"; diff --git a/lib/msal-common/src/response/ResponseHandler.ts b/lib/msal-common/src/response/ResponseHandler.ts index bb2d08face..84078936dd 100644 --- a/lib/msal-common/src/response/ResponseHandler.ts +++ b/lib/msal-common/src/response/ResponseHandler.ts @@ -38,8 +38,6 @@ import { TokenCacheContext } from "../cache/persistence/TokenCacheContext.js"; import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache.js"; import { AuthorizationCodePayload } from "./AuthorizationCodePayload.js"; import { BaseAuthRequest } from "../request/BaseAuthRequest.js"; -import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js"; -import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent.js"; import { checkMaxAge, extractTokenClaims } from "../account/AuthToken.js"; import { TokenClaims, @@ -66,7 +64,6 @@ export class ResponseHandler { private homeAccountIdentifier: string; private serializableCache: ISerializableTokenCache | null; private persistencePlugin: ICachePlugin | null; - private performanceClient?: IPerformanceClient; constructor( clientId: string, @@ -74,8 +71,7 @@ export class ResponseHandler { cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, - persistencePlugin: ICachePlugin | null, - performanceClient?: IPerformanceClient + persistencePlugin: ICachePlugin | null ) { this.clientId = clientId; this.cacheStorage = cacheStorage; @@ -83,7 +79,6 @@ export class ResponseHandler { this.logger = logger; this.serializableCache = serializableCache; this.persistencePlugin = persistencePlugin; - this.performanceClient = performanceClient; } /** @@ -190,11 +185,6 @@ export class ResponseHandler { forceCacheRefreshTokenResponse?: boolean, serverRequestId?: string ): Promise { - this.performanceClient?.addQueueMeasurement( - PerformanceEvents.HandleServerTokenResponse, - serverTokenResponse.correlation_id - ); - // create an idToken object (not entity) let idTokenClaims: TokenClaims | undefined; if (serverTokenResponse.id_token) { diff --git a/lib/msal-common/src/telemetry/performance/IPerformanceClient.ts b/lib/msal-common/src/telemetry/performance/IPerformanceClient.ts index eeadf485d8..dfadd1598a 100644 --- a/lib/msal-common/src/telemetry/performance/IPerformanceClient.ts +++ b/lib/msal-common/src/telemetry/performance/IPerformanceClient.ts @@ -37,32 +37,4 @@ export interface IPerformanceClient { addPerformanceCallback(callback: PerformanceCallbackFunction): string; emitEvents(events: PerformanceEvent[], correlationId: string): void; generateId(): string; - calculateQueuedTime(preQueueTime: number, currentTime: number): number; - addQueueMeasurement( - eventName: string, - correlationId?: string, - queueTime?: number, - manuallyCompleted?: boolean - ): void; - setPreQueueTime(eventName: string, correlationId?: string): void; } - -/** - * Queue measurement type - */ -export type QueueMeasurement = { - /** - * Name of performance event - */ - eventName: string; - - /** - * Time spent in JS queue - */ - queueTime: number; - - /** - * Incomplete pre-queue events are instrumentation bugs that should be fixed. - */ - manuallyCompleted?: boolean; -}; diff --git a/lib/msal-common/src/telemetry/performance/PerformanceClient.ts b/lib/msal-common/src/telemetry/performance/PerformanceClient.ts index 4a796990ca..41d3ed8d83 100644 --- a/lib/msal-common/src/telemetry/performance/PerformanceClient.ts +++ b/lib/msal-common/src/telemetry/performance/PerformanceClient.ts @@ -9,14 +9,12 @@ import { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction, - QueueMeasurement, } from "./IPerformanceClient.js"; import { IntFields, PerformanceEvent, PerformanceEventAbbreviations, PerformanceEventContext, - PerformanceEvents, PerformanceEventStackedContext, PerformanceEventStatus, } from "./PerformanceEvent.js"; @@ -25,11 +23,6 @@ import { CacheError } from "../../error/CacheError.js"; import { ServerError } from "../../error/ServerError.js"; import { InteractionRequiredAuthError } from "../../error/InteractionRequiredAuthError.js"; -export interface PreQueueEvent { - name: PerformanceEvents; - time: number; -} - /** * Starts context by adding payload to the stack * @param event {PerformanceEvent} @@ -278,22 +271,6 @@ export abstract class PerformanceClient implements IPerformanceClient { */ protected eventsByCorrelationId: Map; - /** - * Map of pre-queue times by correlation Id - * - * @protected - * @type {Map} - */ - protected preQueueTimeByCorrelationId: Map; - - /** - * Map of queue measurements by correlation Id - * - * @protected - * @type {Map>} - */ - protected queueMeasurements: Map>; - protected intFields: Set; /** @@ -343,8 +320,6 @@ export abstract class PerformanceClient implements IPerformanceClient { this.callbacks = new Map(); this.eventsByCorrelationId = new Map(); this.eventStack = new Map(); - this.queueMeasurements = new Map(); - this.preQueueTimeByCorrelationId = new Map(); this.intFields = intFields || new Set(); for (const item of IntFields) { this.intFields.add(item); @@ -363,136 +338,6 @@ export abstract class PerformanceClient implements IPerformanceClient { */ abstract generateId(): string; - /** - * Sets pre-queue time by correlation Id - * - * @abstract - * @param {PerformanceEvents} eventName - * @param {string} correlationId - * @returns - */ - abstract setPreQueueTime( - eventName: PerformanceEvents, - correlationId?: string - ): void; - - /** - * Gets map of pre-queue times by correlation Id - * - * @param {PerformanceEvents} eventName - * @param {string} correlationId - * @returns {number} - */ - getPreQueueTime(eventName: string, correlationId: string): number | void { - const preQueueEvent: PreQueueEvent | undefined = - this.preQueueTimeByCorrelationId.get(correlationId); - - if (!preQueueEvent) { - this.logger.trace( - `PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${correlationId}, unable to add queue measurement` - ); - return; - } else if (preQueueEvent.name !== eventName) { - this.logger.trace( - `PerformanceClient.getPreQueueTime: no pre-queue time found for ${eventName}, unable to add queue measurement` - ); - return; - } - - return preQueueEvent.time; - } - - /** - * Calculates the difference between current time and time when function was queued. - * Note: It is possible to have 0 as the queue time if the current time and the queued time was the same. - * - * @param {number} preQueueTime - * @param {number} currentTime - * @returns {number} - */ - calculateQueuedTime(preQueueTime: number, currentTime: number): number { - if (preQueueTime < 1) { - this.logger.trace( - `PerformanceClient: preQueueTime should be a positive integer and not ${preQueueTime}` - ); - return 0; - } - - if (currentTime < 1) { - this.logger.trace( - `PerformanceClient: currentTime should be a positive integer and not ${currentTime}` - ); - return 0; - } - - if (currentTime < preQueueTime) { - this.logger.trace( - "PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved" - ); - return 0; - } - - return currentTime - preQueueTime; - } - - /** - * Adds queue measurement time to QueueMeasurements array for given correlation ID. - * - * @param {PerformanceEvents} eventName - * @param {?string} correlationId - * @param {?number} queueTime - * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements - * @returns - */ - addQueueMeasurement( - eventName: string, - correlationId?: string, - queueTime?: number, - manuallyCompleted?: boolean - ): void { - if (!correlationId) { - this.logger.trace( - `PerformanceClient.addQueueMeasurement: correlationId not provided for ${eventName}, cannot add queue measurement` - ); - return; - } - - if (queueTime === 0) { - // Possible for there to be no queue time after calculation - this.logger.trace( - `PerformanceClient.addQueueMeasurement: queue time provided for ${eventName} is ${queueTime}` - ); - } else if (!queueTime) { - this.logger.trace( - `PerformanceClient.addQueueMeasurement: no queue time provided for ${eventName}` - ); - return; - } - - const queueMeasurement: QueueMeasurement = { - eventName, - // Always default queue time to 0 for manually completed (improperly instrumented) - queueTime: manuallyCompleted ? 0 : queueTime, - manuallyCompleted, - }; - - // Adds to existing correlation Id if present in queueMeasurements - const existingMeasurements = this.queueMeasurements.get(correlationId); - if (existingMeasurements) { - existingMeasurements.push(queueMeasurement); - this.queueMeasurements.set(correlationId, existingMeasurements); - } else { - // Sets new correlation Id if not present in queueMeasurements - this.logger.trace( - `PerformanceClient.addQueueMeasurement: adding correlationId ${correlationId} to queue measurements` - ); - const measurementArray = [queueMeasurement]; - this.queueMeasurements.set(correlationId, measurementArray); - } - // Delete processed pre-queue event. - this.preQueueTimeByCorrelationId.delete(correlationId); - } - /** * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement. * @@ -597,11 +442,6 @@ export abstract class PerformanceClient implements IPerformanceClient { } const isRoot = event.eventId === rootEvent.eventId; - let queueInfo = { - totalQueueTime: 0, - totalQueueCount: 0, - manuallyCompletedCount: 0, - }; event.durationMs = Math.round( event.durationMs || this.getDurationMs(event.startTimeMs) @@ -617,7 +457,6 @@ export abstract class PerformanceClient implements IPerformanceClient { ); if (isRoot) { - queueInfo = this.getQueueInfo(event.correlationId); this.discardMeasurements(rootEvent.correlationId); } else { rootEvent.incompleteSubMeasurements?.delete(event.eventId); @@ -665,9 +504,6 @@ export abstract class PerformanceClient implements IPerformanceClient { finalEvent = { ...finalEvent, - queuedTimeMs: queueInfo.totalQueueTime, - queuedCount: queueInfo.totalQueueCount, - queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount, status: PerformanceEventStatus.Completed, incompleteSubsCount, context, @@ -762,35 +598,6 @@ export abstract class PerformanceClient implements IPerformanceClient { } } - private getQueueInfo(correlationId: string): { - totalQueueTime: number; - totalQueueCount: number; - manuallyCompletedCount: number; - } { - const queueMeasurementForCorrelationId = - this.queueMeasurements.get(correlationId); - if (!queueMeasurementForCorrelationId) { - this.logger.trace( - `PerformanceClient: no queue measurements found for for correlationId: ${correlationId}` - ); - } - - let totalQueueTime = 0; - let totalQueueCount = 0; - let manuallyCompletedCount = 0; - queueMeasurementForCorrelationId?.forEach((measurement) => { - totalQueueTime += measurement.queueTime; - totalQueueCount++; - manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0; - }); - - return { - totalQueueTime, - totalQueueCount, - manuallyCompletedCount, - }; - } - /** * Removes measurements and aux data for a given correlation id. * @@ -803,18 +610,6 @@ export abstract class PerformanceClient implements IPerformanceClient { ); this.eventsByCorrelationId.delete(correlationId); - this.logger.trace( - "PerformanceClient: QueueMeasurements discarded", - correlationId - ); - this.queueMeasurements.delete(correlationId); - - this.logger.trace( - "PerformanceClient: Pre-queue times discarded", - correlationId - ); - this.preQueueTimeByCorrelationId.delete(correlationId); - this.logger.trace( "PerformanceClient: Event stack discarded", correlationId diff --git a/lib/msal-common/src/telemetry/performance/PerformanceEvent.ts b/lib/msal-common/src/telemetry/performance/PerformanceEvent.ts index 6edd889ae5..5e57ced098 100644 --- a/lib/msal-common/src/telemetry/performance/PerformanceEvent.ts +++ b/lib/msal-common/src/telemetry/performance/PerformanceEvent.ts @@ -730,13 +730,6 @@ export type PerformanceEvent = { */ cacheOutcome?: number; - /** - * Amount of time spent in the JS queue in milliseconds. - * - * @type {?number} - */ - queuedTimeMs?: number; - /** * Sub-measurements for internal use. To be deleted before flushing. */ @@ -749,18 +742,6 @@ export type PerformanceEvent = { * CorrelationId of the in progress iframe request that was awaited */ awaitIframeCorrelationId?: string; - /** - * Amount of times queued in the JS event queue. - * - * @type {?number} - */ - queuedCount?: number; - /** - * Amount of manually completed queue events. - * - * @type {?number} - */ - queuedManuallyCompletedCount?: number; /** * Size of the id token @@ -909,7 +890,6 @@ export const IntFields: ReadonlySet = new Set([ "matsSilentStatus", "matsHttpStatus", "refreshTokenSize", - "queuedTimeMs", "startTimeMs", "status", "multiMatchedAT", diff --git a/lib/msal-common/src/telemetry/performance/StubPerformanceClient.ts b/lib/msal-common/src/telemetry/performance/StubPerformanceClient.ts index e868c64fdd..64121f4c13 100644 --- a/lib/msal-common/src/telemetry/performance/StubPerformanceClient.ts +++ b/lib/msal-common/src/telemetry/performance/StubPerformanceClient.ts @@ -53,18 +53,6 @@ export class StubPerformanceClient implements IPerformanceClient { }; } - calculateQueuedTime(): number { - return 0; - } - - addQueueMeasurement(): void { - return; - } - - setPreQueueTime(): void { - return; - } - endMeasurement(): PerformanceEvent | null { return null; } diff --git a/lib/msal-common/src/utils/FunctionWrappers.ts b/lib/msal-common/src/utils/FunctionWrappers.ts index b962953cda..50652a2350 100644 --- a/lib/msal-common/src/utils/FunctionWrappers.ts +++ b/lib/msal-common/src/utils/FunctionWrappers.ts @@ -98,7 +98,6 @@ export const invokeAsync = , U>( correlationId ); } - telemetryClient?.setPreQueueTime(eventName, correlationId); return callback(...args) .then((response) => { logger.trace(`Returning result from ${eventName}`); diff --git a/lib/msal-common/test/telemetry/PerformanceClient.spec.ts b/lib/msal-common/test/telemetry/PerformanceClient.spec.ts index c859174c3c..2a9bb3527c 100644 --- a/lib/msal-common/test/telemetry/PerformanceClient.spec.ts +++ b/lib/msal-common/test/telemetry/PerformanceClient.spec.ts @@ -68,16 +68,6 @@ export class MockPerformanceClient return this.guidGenerator.generateGuid(); } - setPreQueueTime( - eventName: PerformanceEvents, - correlationId?: string | undefined - ): void { - this.preQueueTimeByCorrelationId.set(correlationId || "", { - name: eventName, - time: 12345, - }); - } - getDurationMs(startTimeMs: number): number { return samplePerfDuration; } @@ -518,54 +508,6 @@ describe("PerformanceClient.spec.ts", () => { }); }); - it("captures total count of manually completed queue events", (done) => { - const mockPerfClient = new MockPerformanceClient(); - const correlationId = "test-correlation-id"; - - mockPerfClient.addPerformanceCallback((events) => { - expect(events.length).toEqual(1); - const event = events[0]; - expect(event.queuedCount).toEqual(4); - expect(event.queuedManuallyCompletedCount).toEqual(2); - expect(event.queuedTimeMs).toEqual(3); - done(); - }); - - const topLevelEvent = mockPerfClient.startMeasurement( - PerformanceEvents.AcquireTokenSilent, - correlationId - ); - - mockPerfClient.addQueueMeasurement( - PerformanceEvents.SilentCacheClientAcquireToken, - topLevelEvent.event.correlationId, - 1, - false - ); - mockPerfClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenSilent, - topLevelEvent.event.correlationId, - 2, - false - ); - mockPerfClient.addQueueMeasurement( - PerformanceEvents.AcquireTokenByRefreshToken, - topLevelEvent.event.correlationId, - 3, - true - ); - mockPerfClient.addQueueMeasurement( - PerformanceEvents.GetAuthCodeUrl, - topLevelEvent.event.correlationId, - 4, - true - ); - - topLevelEvent.end({ - success: true, - }); - }); - describe("addError", () => { it("adds error", (done) => { const mockPerfClient = new MockPerformanceClient(); @@ -837,32 +779,6 @@ describe("PerformanceClient.spec.ts", () => { }); }); - describe("calculateQueuedTime", () => { - it("returns the queuedTime calculation", () => { - const mockPerfClient = new MockPerformanceClient(); - const result = mockPerfClient.calculateQueuedTime(1, 2); - expect(result).toBe(1); - }); - - it("returns 0 if preQueueTime is not positive integer", () => { - const mockPerfClient = new MockPerformanceClient(); - const result = mockPerfClient.calculateQueuedTime(-1, 1); - expect(result).toBe(0); - }); - - it("returns 0 if currentTime is not positive integer", () => { - const mockPerfClient = new MockPerformanceClient(); - const result = mockPerfClient.calculateQueuedTime(1, -1); - expect(result).toBe(0); - }); - - it("returns 0 if preQueueTime is greater than currentTime", () => { - const mockPerfClient = new MockPerformanceClient(); - const result = mockPerfClient.calculateQueuedTime(2, 1); - expect(result).toBe(0); - }); - }); - describe("context", () => { const perfDuration = Math.round(samplePerfDuration); const abbrEventName = (name: string) => { @@ -1322,18 +1238,10 @@ describe("PerformanceClient.spec.ts", () => { PerformanceEvents.AcquireTokenSilentAsync, correlationId ); - mockPerfClient.setPreQueueTime( - PerformanceEvents.AcquireTokenSilentAsync, - correlationId - ); const secondEvent = mockPerfClient.startMeasurement( PerformanceEvents.AcquireTokenFromCache, correlationId ); - mockPerfClient.setPreQueueTime( - PerformanceEvents.AcquireTokenFromCache, - correlationId - ); secondEvent.end({ success: true }); firstEvent.end({ success: true }); rootEvent.discard(); @@ -1342,23 +1250,11 @@ describe("PerformanceClient.spec.ts", () => { PerformanceEvents.AcquireTokenSilent, dummyCorrelationId ); - mockPerfClient.setPreQueueTime( - PerformanceEvents.AcquireTokenSilent, - dummyCorrelationId - ); expect( // @ts-ignore mockPerfClient.eventsByCorrelationId.has(correlationId) ).toBeFalsy(); - expect( - // @ts-ignore - mockPerfClient.preQueueTimeByCorrelationId.has(correlationId) - ).toBeFalsy(); - expect( - // @ts-ignore - mockPerfClient.queueMeasurements.has(correlationId) - ).toBeFalsy(); // @ts-ignore expect(mockPerfClient.eventStack.has(correlationId)).toBeFalsy(); @@ -1366,12 +1262,6 @@ describe("PerformanceClient.spec.ts", () => { // @ts-ignore mockPerfClient.eventsByCorrelationId.has(dummyCorrelationId) ).toBeTruthy(); - expect( - // @ts-ignore - mockPerfClient.preQueueTimeByCorrelationId.has( - dummyCorrelationId - ) - ).toBeTruthy(); expect( // @ts-ignore mockPerfClient.eventStack.has(dummyCorrelationId)