Skip to content

Commit

Permalink
Enable telemetry in runner page
Browse files Browse the repository at this point in the history
  • Loading branch information
aznhassan committed Dec 6, 2023
1 parent 38638ce commit f9ce4be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pxtrunner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ namespace pxt.runner {

function initInnerAsync() {
pxt.setAppTarget((window as any).pxtTargetBundle)
pxt.analytics.enable(pxt.Util.userLanguage());
Util.assert(!!pxt.appTarget);

const href = window.location.href;
Expand Down Expand Up @@ -470,7 +471,7 @@ namespace pxt.runner {
try {
const start = Date.now();
const result = await pxt.Cloud.downloadBuiltSimJsInfoAsync(simOptions.id);
tickEvent("runner.fetchSimJsInfo", { downloadTime: Date.now() - start });
pxt.tickEvent("runner.fetchSimJsInfo", { duration: Date.now() - start});
return result;
} catch (e) {
// This exception will happen in the majority of cases, so we don't want to log it unless for debugging.
Expand Down Expand Up @@ -543,7 +544,7 @@ namespace pxt.runner {

const res = pxtc.buildSimJsInfo(compileResult);
res.parts = compileResult.usedParts;
tickEvent("runner.buildSimJsInfo", { compileTime: Date.now() - start });
pxt.tickEvent("runner.buildSimJsInfo", { duration: Date.now() - start});
return res;
}

Expand Down

0 comments on commit f9ce4be

Please sign in to comment.