report telemetry even when not auto (#215792)

This commit is contained in:
Sandeep Somavarapu 2024-06-16 23:08:36 +02:00 committed by GitHub
parent 8dcd7945af
commit fc1a9a48ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1299,7 +1299,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
return undefined;
}
async updateRunningExtensions(auto?: boolean): Promise<void> {
async updateRunningExtensions(auto: boolean = false): Promise<void> {
const toAdd: ILocalExtension[] = [];
const toRemove: string[] = [];
@ -1342,17 +1342,17 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
if (toAdd.length || toRemove.length) {
if (await this.extensionService.stopExtensionHosts(nls.localize('restart', "Enable or Disable extensions"), auto)) {
await this.extensionService.startExtensionHosts({ toAdd, toRemove });
if (auto) {
type ExtensionsAutoRestartClassification = {
owner: 'sandy081';
comment: 'Report when extensions are auto restarted';
count: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of extensions auto restarted' };
};
type ExtensionsAutoRestartEvent = {
count: number;
};
this.telemetryService.publicLog2<ExtensionsAutoRestartEvent, ExtensionsAutoRestartClassification>('extensions:autorestart', { count: toAdd.length + toRemove.length });
}
type ExtensionsAutoRestartClassification = {
owner: 'sandy081';
comment: 'Report when extensions are auto restarted';
count: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of extensions auto restarted' };
auto: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Whether the restart was triggered automatically' };
};
type ExtensionsAutoRestartEvent = {
count: number;
auto: boolean;
};
this.telemetryService.publicLog2<ExtensionsAutoRestartEvent, ExtensionsAutoRestartClassification>('extensions:autorestart', { count: toAdd.length + toRemove.length, auto });
}
}
}