From b3053c9cfedbd1263ffc4cc23e6db3f1708ee3d7 Mon Sep 17 00:00:00 2001 From: Hassan Sufi Date: Wed, 6 Dec 2023 06:52:26 -0800 Subject: [PATCH] Use single event with operatin name to track peformance --- pxtrunner/runner.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pxtrunner/runner.ts b/pxtrunner/runner.ts index efa015fb89d6..273c711cd109 100644 --- a/pxtrunner/runner.ts +++ b/pxtrunner/runner.ts @@ -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. @@ -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; }