Skip to content

Commit 014beb7

Browse files
authored
report new window profile switch (#213566)
1 parent 1e2258a commit 014beb7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/vs/workbench/contrib/userDataProfile/browser/userDataProfile.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
1818
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
1919
import { URI } from 'vs/base/common/uri';
2020
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
21-
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
21+
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
2222
import { IWorkspaceTagsService } from 'vs/workbench/contrib/tags/common/workspaceTags';
2323
import { getErrorMessage } from 'vs/base/common/errors';
2424
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
@@ -40,6 +40,7 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
4040
private readonly currentProfileContext: IContextKey<string>;
4141
private readonly isCurrentProfileTransientContext: IContextKey<boolean>;
4242
private readonly hasProfilesContext: IContextKey<boolean>;
43+
private readonly startTime: number = Date.now();
4344

4445
constructor(
4546
@IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService,
@@ -206,6 +207,19 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
206207
}
207208
async run(accessor: ServicesAccessor) {
208209
if (that.userDataProfileService.currentProfile.id !== profile.id) {
210+
if (profile.isDefault && Date.now() - that.startTime < (1000 * 20 /* 20 seconds */)) {
211+
type SwitchToDefaultProfileInfoClassification = {
212+
owner: 'sandy081';
213+
comment: 'Report if the user switches to the default profile.';
214+
emptyWindow: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'If the current window is empty window or not' };
215+
};
216+
type SwitchToDefaultProfileInfoEvent = {
217+
emptyWindow: boolean;
218+
};
219+
that.telemetryService.publicLog2<SwitchToDefaultProfileInfoEvent, SwitchToDefaultProfileInfoClassification>('profiles:newwindowprofile', {
220+
emptyWindow: that.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY
221+
});
222+
}
209223
return that.userDataProfileManagementService.switchProfile(profile);
210224
}
211225
}

0 commit comments

Comments
 (0)