Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

aux window - add telemetry to track how many windows open #199004

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import Severity from 'vs/base/common/severity';
import { BaseWindow } from 'vs/workbench/browser/window';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';

export const IAuxiliaryWindowService = createDecorator<IAuxiliaryWindowService>('auxiliaryWindowService');

Expand Down Expand Up @@ -145,7 +146,8 @@ export class BrowserAuxiliaryWindowService extends Disposable implements IAuxili
constructor(
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IDialogService private readonly dialogService: IDialogService,
@IConfigurationService protected readonly configurationService: IConfigurationService
@IConfigurationService protected readonly configurationService: IConfigurationService,
@ITelemetryService private readonly telemetryService: ITelemetryService
) {
super();
}
Expand Down Expand Up @@ -186,6 +188,16 @@ export class BrowserAuxiliaryWindowService extends Disposable implements IAuxili

mark('code/auxiliaryWindow/didOpen');

type AuxiliaryWindowClassification = {
owner: 'bpasero';
comment: 'An event that fires when an auxiliary window is opened';
bounds: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'Has window bounds provided.' };
};
type AuxiliaryWindowOpenEvent = {
bounds: boolean;
};
this.telemetryService.publicLog2<AuxiliaryWindowOpenEvent, AuxiliaryWindowClassification>('auxiliaryWindowOpen', { bounds: !!options?.bounds });

return auxiliaryWindow;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { mark } from 'vs/base/common/performance';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { NativeWindow } from 'vs/workbench/electron-sandbox/window';
import { ShutdownReason } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';

type NativeCodeWindow = CodeWindow & {
readonly vscode: ISandboxGlobals;
Expand Down Expand Up @@ -59,9 +60,10 @@ export class NativeAuxiliaryWindowService extends BrowserAuxiliaryWindowService
@IConfigurationService configurationService: IConfigurationService,
@INativeHostService private readonly nativeHostService: INativeHostService,
@IDialogService dialogService: IDialogService,
@IInstantiationService private readonly instantiationService: IInstantiationService
@IInstantiationService private readonly instantiationService: IInstantiationService,
@ITelemetryService telemetryService: ITelemetryService
) {
super(layoutService, dialogService, configurationService);
super(layoutService, dialogService, configurationService, telemetryService);
}

protected override async resolveWindowId(auxiliaryWindow: NativeCodeWindow): Promise<number> {
Expand Down