Skip to content

Commit

Permalink
Use single event with operatin name to track peformance
Browse files Browse the repository at this point in the history
  • Loading branch information
aznhassan committed Dec 6, 2023
1 parent a25e584 commit b3053c9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pxtrunner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,10 @@ namespace pxt.runner {
try {
const start = Date.now();
const result = await pxt.Cloud.downloadBuiltSimJsInfoAsync(simOptions.id);
pxt.tickEvent("runner.fetchSimJsInfo", { durationMs: Date.now() - start });
pxt.tickEvent("perfMeasurement", {
durationMs: Date.now() - start,
operation: "fetchSimJsInfo",
});
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 @@ -544,7 +547,10 @@ namespace pxt.runner {

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

Expand Down

0 comments on commit b3053c9

Please sign in to comment.