Skip to content

Commit

Permalink
chore: changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Jun 24, 2024
1 parent eeaa464 commit 7b1994b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/e2e/utils/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {ThreadNames} from '@perf-profiler/types';
import type {Measure} from '@perf-profiler/types';

let measures: Measure[] = [];
let polling = {
const POLLING_STOPPED = {
stop: (): void => {
throw new Error('Cannot stop polling on a stopped profiler');
},
};
let polling = POLLING_STOPPED;

const start = (bundleId: string) => {
// clear our measurements results
Expand All @@ -23,6 +24,7 @@ const start = (bundleId: string) => {

const stop = () => {
polling.stop();
polling = POLLING_STOPPED;

const average = getAverageCpuUsagePerProcess(measures);
const uiThread = average.find(({processName}) => processName === ThreadNames.ANDROID.UI)?.cpuUsage;
Expand Down

0 comments on commit 7b1994b

Please sign in to comment.