Skip to content

Commit 9a78289

Browse files
authored
encode the installation type in install telemetry (#3513)
1 parent 7960904 commit 9a78289

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Extension/src/installationInformation.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
* See 'LICENSE' in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55

6+
export enum InstallationType {
7+
Online,
8+
Offline
9+
}
10+
611
export class InstallationInformation {
712
stage: string;
13+
type: InstallationType;
814
hasError: boolean;
915
telemetryProperties: { [key: string]: string };
1016

@@ -25,4 +31,8 @@ export function getInstallationInformation(): InstallationInformation {
2531

2632
export function setInstallationStage(stage: string): void {
2733
getInstallationInformation().stage = stage;
34+
}
35+
36+
export function setInstallationType(type: InstallationType): void {
37+
getInstallationInformation().type = type;
2838
}

Extension/src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistr
1818
import { PlatformInformation } from './platform';
1919
import { PackageManager, PackageManagerError, IPackage } from './packageManager';
2020
import { PersistentState } from './LanguageServer/persistentState';
21-
import { getInstallationInformation, InstallationInformation, setInstallationStage } from './installationInformation';
21+
import { getInstallationInformation, InstallationInformation, setInstallationStage, setInstallationType, InstallationType } from './installationInformation';
2222
import { Logger, getOutputChannelLogger, showOutputChannel } from './logger';
2323
import { CppTools1 } from './cppTools1';
2424

@@ -87,6 +87,7 @@ async function processRuntimeDependencies(): Promise<void> {
8787

8888
async function offlineInstallation(): Promise<void> {
8989
setInstallationStage('getPlatformInfo');
90+
setInstallationType(InstallationType.Offline);
9091
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
9192

9293
setInstallationStage('makeBinariesExecutable');
@@ -107,6 +108,7 @@ async function offlineInstallation(): Promise<void> {
107108

108109
async function onlineInstallation(): Promise<void> {
109110
setInstallationStage('getPlatformInfo');
111+
setInstallationType(InstallationType.Online);
110112
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
111113

112114
await downloadAndInstallPackages(info);
@@ -234,6 +236,7 @@ function sendTelemetry(info: PlatformInformation): boolean {
234236
const success: boolean = !installBlob.hasError;
235237

236238
installBlob.telemetryProperties['success'] = success.toString();
239+
installBlob.telemetryProperties['type'] = installBlob.type === InstallationType.Online ? "online" : "offline";
237240

238241
if (info.distribution) {
239242
installBlob.telemetryProperties['linuxDistroName'] = info.distribution.name;

0 commit comments

Comments
 (0)