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 a66eae7 commit 8fa73cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/server/binary/binaryServerStarter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ async function downloadBinary(): Promise<string> {
});
});
downloadPromise.then((_binaryPath) => {
Telemetry.sendTelemetry(Telemetry.BINARY_DOWNLOAD_SUCCEEDED_EVT);
const data: any = {};
data[Telemetry.BINARY_DOWNLOAD_SUCCEEDED_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_SUCCEEDED_PROP] = false;
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: string = "xml_open_java_download_link";
export const SETTINGS_EVT: string = "xml_settings";
export const BINARY_DOWNLOAD_EVT: string = "xml_binary_download";

export const BINARY_DOWNLOAD_SUCCEEDED_PROP: string = "binary_download_succeeded";

let _telemetryManager: TelemetryService = null;

Expand Down

0 comments on commit 8fa73cb

Please sign in to comment.