Skip to content

Commit b72f636

Browse files
committed
duplicate telemetry events
1 parent 0a2ea25 commit b72f636

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ class ChatSetupController extends Disposable {
11301130
this.setStep(ChatSetupStep.SigningIn);
11311131
const result = await this.signIn(providerId);
11321132
if (!result.session) {
1133-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1133+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11341134
return false;
11351135
}
11361136

@@ -1142,7 +1142,7 @@ class ChatSetupController extends Disposable {
11421142
message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.")
11431143
});
11441144
if (!trusted) {
1145-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1145+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11461146
return false;
11471147
}
11481148

@@ -1201,27 +1201,27 @@ class ChatSetupController extends Disposable {
12011201
}
12021202

12031203
if (!session) {
1204-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1204+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12051205
return false; // unexpected
12061206
}
12071207
}
12081208

12091209
signUpResult = await this.requests.signUpLimited(session);
12101210

12111211
if (typeof signUpResult !== 'boolean' /* error */) {
1212-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
1212+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
12131213
}
12141214
}
12151215

12161216
await this.doInstall();
12171217
} catch (error) {
12181218
this.logService.error(`[chat setup] install: error ${error}`);
1219-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1219+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12201220
return false;
12211221
}
12221222

12231223
if (typeof signUpResult === 'boolean') {
1224-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: wasInstalled && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1224+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: wasInstalled && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12251225
}
12261226

12271227
if (wasInstalled && signUpResult === true) {

extensions/copilot/src/platform/parser/test/node/fixtures/chatSetup.ts.getStructure.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@
11301130
<EXPRESSION_STATEMENT-105> this.setStep(ChatSetupStep.SigningIn);
11311131
</EXPRESSION_STATEMENT-105><LEXICAL_DECLARATION-107> const result = await this.signIn(providerId);
11321132
</LEXICAL_DECLARATION-107><IF_STATEMENT-45> if (!result.session) {
1133-
<EXPRESSION_STATEMENT-106> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1133+
<EXPRESSION_STATEMENT-106> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11341134
</EXPRESSION_STATEMENT-106><RETURN_STATEMENT-57> return false;
11351135
</RETURN_STATEMENT-57> }
11361136
</IF_STATEMENT-45><EXPRESSION_STATEMENT-107>
@@ -1142,7 +1142,7 @@
11421142
message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.")
11431143
});
11441144
</LEXICAL_DECLARATION-108><IF_STATEMENT-46> if (!trusted) {
1145-
<EXPRESSION_STATEMENT-109> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1145+
<EXPRESSION_STATEMENT-109> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11461146
</EXPRESSION_STATEMENT-109><RETURN_STATEMENT-58> return false;
11471147
</RETURN_STATEMENT-58> }
11481148
</IF_STATEMENT-46><COMMENT-32>
@@ -1201,27 +1201,27 @@
12011201
</COMMENT-36> }
12021202
</TRY_STATEMENT-10><IF_STATEMENT-51>
12031203
if (!session) {
1204-
<EXPRESSION_STATEMENT-117> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1204+
<EXPRESSION_STATEMENT-117> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12051205
</EXPRESSION_STATEMENT-117><RETURN_STATEMENT-62> return false; // unexpected
12061206
</RETURN_STATEMENT-62> }
12071207
</IF_STATEMENT-51> }
12081208
</IF_STATEMENT-50><EXPRESSION_STATEMENT-118>
12091209
signUpResult = await this.requests.signUpLimited(session);
12101210
</EXPRESSION_STATEMENT-118><IF_STATEMENT-52>
12111211
if (typeof signUpResult !== 'boolean'<COMMENT-37> /* error */</COMMENT-37>) {
1212-
<EXPRESSION_STATEMENT-119> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
1212+
<EXPRESSION_STATEMENT-119> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
12131213
</EXPRESSION_STATEMENT-119> }
12141214
</IF_STATEMENT-52> }
12151215
</IF_STATEMENT-49><EXPRESSION_STATEMENT-120>
12161216
await this.doInstall();
12171217
</EXPRESSION_STATEMENT-120> } catch (error) {
12181218
<EXPRESSION_STATEMENT-121> this.logService.error(`[chat setup] install: error ${error}`);
1219-
</EXPRESSION_STATEMENT-121><EXPRESSION_STATEMENT-122> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1219+
</EXPRESSION_STATEMENT-121><EXPRESSION_STATEMENT-122> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12201220
</EXPRESSION_STATEMENT-122><RETURN_STATEMENT-63> return false;
12211221
</RETURN_STATEMENT-63> }
12221222
</TRY_STATEMENT-9><IF_STATEMENT-53>
12231223
if (typeof signUpResult === 'boolean') {
1224-
<EXPRESSION_STATEMENT-123> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: wasInstalled && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1224+
<EXPRESSION_STATEMENT-123> this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: wasInstalled && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12251225
</EXPRESSION_STATEMENT-123> }
12261226
</IF_STATEMENT-53><IF_STATEMENT-54>
12271227
if (wasInstalled && signUpResult === true) {

extensions/copilot/test/scenarios/test-tools/workspace/chatSetup.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class ChatSetup {
645645
success = await this.controller.value.setup();
646646
break;
647647
case ChatSetupStrategy.Canceled:
648-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedMaybeLater', installDuration: 0, signUpErrorCode: undefined });
648+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedMaybeLater', installDuration: 0, signUpErrorCode: undefined });
649649
break;
650650
}
651651
} catch (error) {
@@ -1173,7 +1173,7 @@ class ChatSetupController extends Disposable {
11731173
this.setStep(ChatSetupStep.SigningIn);
11741174
const result = await this.signIn(providerId);
11751175
if (!result.session) {
1176-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1176+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11771177
return false;
11781178
}
11791179

@@ -1185,7 +1185,7 @@ class ChatSetupController extends Disposable {
11851185
message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.")
11861186
});
11871187
if (!trusted) {
1188-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1188+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
11891189
return false;
11901190
}
11911191

@@ -1244,27 +1244,27 @@ class ChatSetupController extends Disposable {
12441244
}
12451245

12461246
if (!session) {
1247-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1247+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedNoSession', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12481248
return false; // unexpected
12491249
}
12501250
}
12511251

12521252
signUpResult = await this.requests.signUpLimited(session);
12531253

12541254
if (typeof signUpResult !== 'boolean' /* error */) {
1255-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
1255+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
12561256
}
12571257
}
12581258

12591259
await this.doInstall();
12601260
} catch (error) {
12611261
this.logService.error(`[chat setup] install: error ${error}`);
1262-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1262+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: isCancellationError(error) ? 'cancelled' : 'failedInstall', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12631263
return false;
12641264
}
12651265

12661266
if (typeof signUpResult === 'boolean') {
1267-
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: wasRunning && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
1267+
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.ChatInstall', { installResult: wasRunning && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
12681268
}
12691269

12701270
if (wasRunning && signUpResult === true) {

0 commit comments

Comments
 (0)