fix: use compare with --cpu for Firefox failed. (#4324)
This catches if we got no longtask information.
This commit is contained in:
parent
d3a27f42e5
commit
957fe5220b
|
|
@ -275,16 +275,18 @@ function getCPU(data) {
|
|||
};
|
||||
|
||||
for (const run of data.cpu) {
|
||||
const longTasks = run.longTasks;
|
||||
cpuMetrics['tasks'].push(longTasks['tasks']);
|
||||
cpuMetrics['totalDuration'].push(longTasks['totalDuration']);
|
||||
cpuMetrics['lastLongTask'].push(longTasks['lastLongTask']);
|
||||
cpuMetrics['beforeFirstContentfulPaint'].push(
|
||||
longTasks['beforeFirstContentfulPaint'].totalDuration
|
||||
);
|
||||
cpuMetrics['beforeLargestContentfulPaint'].push(
|
||||
longTasks['beforeLargestContentfulPaint'].totalDuration
|
||||
);
|
||||
if (run.longTasks) {
|
||||
const longTasks = run.longTasks;
|
||||
cpuMetrics['tasks'].push(longTasks['tasks']);
|
||||
cpuMetrics['totalDuration'].push(longTasks['totalDuration']);
|
||||
cpuMetrics['lastLongTask'].push(longTasks['lastLongTask']);
|
||||
cpuMetrics['beforeFirstContentfulPaint'].push(
|
||||
longTasks['beforeFirstContentfulPaint'].totalDuration
|
||||
);
|
||||
cpuMetrics['beforeLargestContentfulPaint'].push(
|
||||
longTasks['beforeLargestContentfulPaint'].totalDuration
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const isEmpty = Object.values(cpuMetrics).every(arr => arr.length === 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue