Skip to content

Commit

Permalink
Change the names of the telemetry events
Browse files Browse the repository at this point in the history
Prefix existing events with `xml_`.
Group the binary download events into `xml_binary_download`.
Add a parameter `binary_download_succeeded` that indicates if the download failed or worked.

Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 committed Apr 14, 2021
1 parent 70cad4d commit d6c4e32
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions USAGE_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ vscode-xml has opt-in telemetry collection, provided by [vscode-commons](https:/
* The server version number
* Does NOT include the `JAVA_HOME` environment variable for privacy reasons
* The value of the `xml.server.preferBinary` setting
* A telemetry event is sent every time the binary server download succeeds
* A telemetry event is sent every time the binary server download fails
* A telemetry event is sent every time the binary server download succeeds or fails
* If the download fails, the associated error is attached to the telemetry event
* A telemetry event is sent every time you click the "Download Java" link that appears when you have [LemMinX extensions](./docs/Extensions.md) installed but don't have Java installed.

## What's included in the general telemetry data
Expand Down
9 changes: 7 additions & 2 deletions src/server/binary/binaryServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,16 @@ async function downloadBinary(): Promise<string> {
});
});
downloadPromise.then((_binaryPath) => {
Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_SUCCEEDED_EVT);
const data: any = {};
data[Telemetry.BINARY_DOWNLOAD_SUCCESS_PROP] = true;
Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_EVT, data);
});
downloadPromise.catch(e => {
if (e !== ABORTED_ERROR) {
Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_FAILED_EVT);
const data: any = {};
data[Telemetry.BINARY_DOWNLOAD_SUCCESS_PROP] = false;
data['error'] = e;
Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_EVT, data);
}
});
return downloadPromise;
Expand Down
9 changes: 5 additions & 4 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { getTelemetryService, TelemetryEvent, TelemetryService } from "@redhat-d
*/
export namespace Telemetry {

export const OPEN_JAVA_DOWNLOAD_LINK_EVT: string = "open_java_download_link";
export const SETTINGS_EVT: string = "settings";
export const BINARY_DOWNLOAD_SUCCEEDED_EVT: string = "binary_download_succeeded";
export const BINARY_DOWNLOAD_FAILED_EVT: string = "binary_download_failed";
export const OPEN_JAVA_DOWNLOAD_LINK_EVT = "xml_open_java_download_link";
export const SETTINGS_EVT = "xml_settings";
export const BINARY_DOWNLOAD_EVT = "xml_binary_download";

export const BINARY_DOWNLOAD_SUCCESS_PROP = "success";

let _telemetryManager: TelemetryService = null;

Expand Down

0 comments on commit d6c4e32

Please sign in to comment.