diff --git a/tests/e2e/testRunner.ts b/tests/e2e/testRunner.ts index b674ac418f3e..297cbbfcce57 100644 --- a/tests/e2e/testRunner.ts +++ b/tests/e2e/testRunner.ts @@ -169,6 +169,16 @@ const runTests = async (): Promise => { branch, duration: metrics.ram, }); + attachTestResult({ + name: `${test.name} (CPU/JS)`, + branch, + duration: metrics.jsThread, + }); + attachTestResult({ + name: `${test.name} (CPU/UI)`, + branch, + duration: metrics.uiThread, + }); } removeListener(); resolve(); diff --git a/tests/e2e/utils/measure.ts b/tests/e2e/utils/measure.ts index c7e7e1837e14..0a5aface56f2 100644 --- a/tests/e2e/utils/measure.ts +++ b/tests/e2e/utils/measure.ts @@ -1,5 +1,6 @@ import {profiler} from '@perf-profiler/profiler'; -import {getAverageCpuUsage, getAverageFPSUsage, getAverageRAMUsage} from '@perf-profiler/reporter'; +import {getAverageCpuUsage, getAverageCpuUsagePerProcess, getAverageFPSUsage, getAverageRAMUsage} from '@perf-profiler/reporter'; +import {ThreadNames} from '@perf-profiler/types'; import type {Measure} from '@perf-profiler/types'; let measures: Measure[] = []; @@ -23,11 +24,17 @@ const start = (bundleId: string) => { const stop = () => { polling.stop(); + const average = getAverageCpuUsagePerProcess(measures); + const uiThread = average.find(({processName}) => processName === ThreadNames.ANDROID.UI)?.cpuUsage; + // most likely this line needs to be updated when we migrate to RN 0.74 with bridgeless mode + const jsThread = average.find(({processName}) => processName === ThreadNames.RN.JS_ANDROID)?.cpuUsage; const cpu = getAverageCpuUsage(measures); const fps = getAverageFPSUsage(measures); const ram = getAverageRAMUsage(measures); return { + uiThread, + jsThread, cpu, fps, ram,