Skip to content

Commit

Permalink
report telemetry even when not auto (microsoft#215792)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 authored and bricefriha committed Jun 26, 2024
1 parent 414add9 commit 83c02fb
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];

Expand Down Expand Up @@ -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 });
}
}
}
Expand Down

0 comments on commit 83c02fb

Please sign in to comment.