From: rniwa@webkit.org Date: Wed, 13 Apr 2016 16:25:13 +0000 (+0000) Subject: REGRESSION(r199444): Perf dashboard always fetches all measurement sets X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=commitdiff_plain;h=cd0094ec750ab29c73dd0285077673ea29a04e09 REGRESSION(r199444): Perf dashboard always fetches all measurement sets https://bugs.webkit.org/show_bug.cgi?id=156534 Reviewed by Darin Adler. The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always constructed in main(), this resulted in all measurement sets being fetched on all pages. * public/v3/pages/summary-page.js: (SummaryPage): (SummaryPage.prototype.open): Fetch measurement set JSONs here. (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@199498 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog index a806cc5..a664ea0 100644 --- a/Websites/perf.webkit.org/ChangeLog +++ b/Websites/perf.webkit.org/ChangeLog @@ -1,3 +1,18 @@ +2016-04-13 Ryosuke Niwa + + REGRESSION(r199444): Perf dashboard always fetches all measurement sets + https://bugs.webkit.org/show_bug.cgi?id=156534 + + Reviewed by Darin Adler. + + The bug was cased by SummaryPage's constructor fetching all measurement sets. Since each page is always + constructed in main(), this resulted in all measurement sets being fetched on all pages. + + * public/v3/pages/summary-page.js: + (SummaryPage): + (SummaryPage.prototype.open): Fetch measurement set JSONs here. + (SummaryPage.prototype._createConfigurationGroup): Renamed from _createConfigurationGroupAndStartFetchingData. + 2016-04-12 Ryosuke Niwa Add a summary page to v3 UI diff --git a/Websites/perf.webkit.org/public/v3/pages/summary-page.js b/Websites/perf.webkit.org/public/v3/pages/summary-page.js index 4877a93..5e60b0f 100644 --- a/Websites/perf.webkit.org/public/v3/pages/summary-page.js +++ b/Websites/perf.webkit.org/public/v3/pages/summary-page.js @@ -11,9 +11,8 @@ class SummaryPage extends PageWithHeading { }; this._shouldConstructTable = true; this._renderQueue = []; + this._configGroups = []; - var current = Date.now(); - var timeRange = [current - 7 * 24 * 3600 * 1000, current]; for (var metricGroup of summarySettings.metricGroups) { var group = {name: metricGroup.name, rows: []}; this._table.groups.push(group); @@ -21,7 +20,7 @@ class SummaryPage extends PageWithHeading { var row = {name: subMetricGroup.name, cells: []}; group.rows.push(row); for (var platformGroup of summarySettings.platformGroups) - row.cells.push(this._createConfigurationGroupAndStartFetchingData(platformGroup.platforms, subMetricGroup.metrics, timeRange)); + row.cells.push(this._createConfigurationGroup(platformGroup.platforms, subMetricGroup.metrics)); } } } @@ -31,6 +30,11 @@ class SummaryPage extends PageWithHeading { open(state) { super.open(state); + + var current = Date.now(); + var timeRange = [current - 7 * 24 * 3600 * 1000, current]; + for (var group of this._configGroups) + group.fetchAndComputeSummary(timeRange).then(this.render.bind(this)); } render() @@ -44,12 +48,12 @@ class SummaryPage extends PageWithHeading { render(); } - _createConfigurationGroupAndStartFetchingData(platformIdList, metricIdList, timeRange) + _createConfigurationGroup(platformIdList, metricIdList) { var platforms = platformIdList.map(function (id) { return Platform.findById(id); }).filter(function (obj) { return !!obj; }); var metrics = metricIdList.map(function (id) { return Metric.findById(id); }).filter(function (obj) { return !!obj; }); var configGroup = new SummaryPageConfigurationGroup(platforms, metrics); - configGroup.fetchAndComputeSummary(timeRange).then(this.render.bind(this)); + this._configGroups.push(configGroup); return configGroup; }