Skip to content

Commit cf3811a

Browse files
authored
chore: Send event for 'query-expfeature' (#375)
1 parent ec7ca25 commit cf3811a

File tree

3 files changed

+19
-30
lines changed

3 files changed

+19
-30
lines changed

package-lock.json

Lines changed: 12 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,6 @@
554554
"lodash": "^4.17.20",
555555
"minimatch": "^3.0.4",
556556
"vscode-extension-telemetry-wrapper": "0.8.0",
557-
"vscode-tas-client": "0.0.659"
557+
"vscode-tas-client": "0.1.4"
558558
}
559559
}

src/ExperimentationService.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import * as fse from "fs-extra";
54
import * as vscode from "vscode";
65
import { addContextProperty, sendInfo } from "vscode-extension-telemetry-wrapper";
76
import { getExperimentationService, IExperimentationService, IExperimentationTelemetry, TargetPopulation } from "vscode-tas-client";
@@ -13,7 +12,12 @@ class ExperimentationTelemetry implements IExperimentationTelemetry {
1312
}
1413

1514
public postEvent(eventName: string, props: Map<string, string>): void {
16-
// do nothing
15+
const payload: any = { __event_name__: eventName };
16+
for (const [key, value] of props) {
17+
payload[key] = value;
18+
}
19+
20+
sendInfo("", payload);
1721
}
1822
}
1923

@@ -31,11 +35,4 @@ export function init(context: vscode.ExtensionContext): void {
3135
// tslint:enable: no-string-literal
3236
expService = getExperimentationService(extensionName, extensionVersion,
3337
TargetPopulation.Public, new ExperimentationTelemetry(), context.globalState);
34-
35-
// Due to a bug in the tas-client module, a call to isFlightEnabledAsync is required to begin
36-
// polling the TAS. Due to a separate bug, this call must be preceeded by a call to isCachedFlightEnabled.
37-
const asyncDummyCheck = (arg: any) => {
38-
expService?.isFlightEnabledAsync("dummy").then((v) => { return; }).catch((r) => { return; });
39-
};
40-
expService?.isCachedFlightEnabled("dummy").then(asyncDummyCheck).catch(asyncDummyCheck);
4138
}

0 commit comments

Comments
 (0)