diff --git a/src/common/telemetry/constants.ts b/src/common/telemetry/constants.ts index 47e45888..e77a2568 100644 --- a/src/common/telemetry/constants.ts +++ b/src/common/telemetry/constants.ts @@ -65,6 +65,9 @@ export enum EventNames { * the timer is cancelled and this event never fires. * Properties: * - failureStage: string (which phase was in progress when the watchdog fired) + * Measures: + * - duration: total elapsed since activation + * - stageDuration: elapsed in the current stage */ SETUP_HANG_DETECTED = 'SETUP.HANG_DETECTED', /** @@ -103,12 +106,10 @@ export enum EventNames { ENV_SELECTION_RESULT = 'ENV_SELECTION.RESULT', /** * Telemetry event fired when applyInitialEnvironmentSelection returns. - * Duration measures the blocking time (excludes deferred global scope). * Properties: - * - globalScopeDeferred: boolean (true = global scope fired in background, false = awaited) - * - workspaceFolderCount: number (total workspace folders) - * - resolvedFolderCount: number (folders that resolved with a non-undefined env) - * - settingErrorCount: number (user-configured settings that could not be applied) + * - globalScopeDeferred: boolean (true = global scope fired in background) + * Measures: + * - duration, workspaceFolderCount, resolvedFolderCount, settingErrorCount */ ENV_SELECTION_COMPLETED = 'ENV_SELECTION.COMPLETED', /** @@ -381,7 +382,8 @@ export interface IEventNamePropertyMapping { /* __GDPR__ "setup.hang_detected": { "failureStage": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "StellaHuang95" }, - "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "StellaHuang95" } + "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" }, + "": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "eleanorjboyd" } } */ [EventNames.SETUP_HANG_DETECTED]: { @@ -451,9 +453,6 @@ export interface IEventNamePropertyMapping { */ [EventNames.ENV_SELECTION_COMPLETED]: { globalScopeDeferred: boolean; - workspaceFolderCount: number; - resolvedFolderCount: number; - settingErrorCount: number; }; /* __GDPR__ diff --git a/src/extension.ts b/src/extension.ts index f635874a..ec8a24cd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -552,6 +552,7 @@ export async function activate(context: ExtensionContext): Promise { let failureStage = 'nativeFinder'; + const stageWatch = new StopWatch(); // Watchdog: fires if setup hasn't completed within 120s, indicating a likely hang const SETUP_HANG_TIMEOUT_MS = 120_000; let hangWatchdogActive = true; @@ -568,7 +569,11 @@ export async function activate(context: ExtensionContext): Promise