Guard against no pages in the HAR (#4430)

This commit is contained in:
Peter Hedenskog 2025-02-05 10:04:54 +01:00 committed by GitHub
parent 5abff0c5ae
commit 65e3751a9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 30 deletions

View File

@ -80,6 +80,8 @@ export class DomainsAggregator {
if (this.groups[mainDomain] === undefined) {
this.groups[mainDomain] = {};
}
if (har.log.pages.length > 0) {
const firstPageId = har.log.pages[0].id;
for (const entry of har.log.entries) {
@ -101,7 +103,9 @@ export class DomainsAggregator {
domain.totalTime.push(totalTime);
groupDomain.totalTime.push(totalTime);
} else {
log.debug('Missing time from har entry for url: ' + entry.request.url);
log.debug(
'Missing time from har entry for url: ' + entry.request.url
);
}
for (const name of timingNames) {
@ -116,6 +120,7 @@ export class DomainsAggregator {
this.groups[mainDomain][domainName] = groupDomain;
}
}
}
summarize() {
const summary = {
groups: {