diff --git a/lib/plugins/pagexray/index.js b/lib/plugins/pagexray/index.js index a2ce9030b3..b85f9b363e 100644 --- a/lib/plugins/pagexray/index.js +++ b/lib/plugins/pagexray/index.js @@ -104,11 +104,7 @@ export default class PageXrayPlugin extends SitespeedioPlugin { } } } - this.pageXrayAggregator.addToAggregate( - pageSummary, - group, - message.url - ); + this.pageXrayAggregator.addToAggregate(pageSummary, group); if (this.multi) { // The HAR file can have multiple URLs const sentURL = {}; diff --git a/lib/plugins/pagexray/pagexrayAggregator.js b/lib/plugins/pagexray/pagexrayAggregator.js index 8d5217dac4..3cfd2cc301 100644 --- a/lib/plugins/pagexray/pagexrayAggregator.js +++ b/lib/plugins/pagexray/pagexrayAggregator.js @@ -15,19 +15,20 @@ export class PageXrayAggregator { this.groups = {}; } - addToAggregate(pageSummary, group, url) { + addToAggregate(pageSummary, group) { if (this.groups[group] === undefined) { this.groups[group] = {}; } - if (this.urls[url] === undefined) { - this.urls[url] = {}; - } - let stats = this.stats; let groups = this.groups; for (const summary of pageSummary) { + let url = summary.url; + if (this.urls[url] === undefined) { + this.urls[url] = {}; + } + // stats for the whole page for (const metric of METRIC_NAMES) { // There's a bug in Firefox/https://github.com/devtools-html/har-export-trigger