Title: [200878] trunk/Websites/perf.webkit.org
Revision
200878
Author
[email protected]
Date
2016-05-13 12:42:38 -0700 (Fri, 13 May 2016)

Log Message

Summary page doesn't report some missing platforms
https://bugs.webkit.org/show_bug.cgi?id=157670

Reviewed by Darin Adler.

This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
any data reported for a given test would not be reported as missing.

* public/v3/pages/summary-page.js:
(SummaryPage.prototype.render): Added instrumentations.
(SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
(SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
spinner and the ratio bar graph in the cell by CSS for better performance.
(SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
for clarity and adopted new API of SummaryPageConfigurationGroup.
(SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
(SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
(SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
(SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
(SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
(SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
(SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (200877 => 200878)


--- trunk/Websites/perf.webkit.org/ChangeLog	2016-05-13 19:42:22 UTC (rev 200877)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2016-05-13 19:42:38 UTC (rev 200878)
@@ -1,5 +1,33 @@
 2016-05-13  Ryosuke Niwa  <[email protected]>
 
+        Summary page doesn't report some missing platforms
+        https://bugs.webkit.org/show_bug.cgi?id=157670
+
+        Reviewed by Darin Adler.
+
+        This patch improves the warning text for missing platforms and fixes the bug that platforms that don't have
+        any data reported for a given test would not be reported as missing.
+
+        * public/v3/pages/summary-page.js:
+        (SummaryPage.prototype.render): Added instrumentations.
+        (SummaryPage.prototype._constructRatioGraph): Always create both the ratio bar graph and the spinner icon.
+        (SummaryPage.prototype._renderCell): Extracted from _constructRatioGraph. Toggle the displayed-ness of the
+        spinner and the ratio bar graph in the cell by CSS for better performance.
+        (SummaryPage.prototype._warningTextForGroup): Extracted from _constructRatioGraph. Rephrased warning text
+        for clarity and adopted new API of SummaryPageConfigurationGroup.
+        (SummaryPage.prototype._warningTextForGroup.mapAndSortByName): Added.
+        (SummaryPage.prototype._warningTextForGroup.pluralizeIfNeeded): Added.
+        (SummaryPage.cssTemplate): Added rules to toggle the visibility of spinner icons and bar graphs.
+        (SummaryPageConfigurationGroup): Replaced this._warnings by more explicitly named this._missingPlatforms
+        and this._platformsWithoutBaseline. Also add a platform to this._missingPlatforms if it didn't appear in
+        any metrics. Note that adding a platform whenever it doesn't in any one metric would be incorrect since
+        some tests uses a different test name on different platforms: e.g. PLT-Mac and PLT-iPhone.
+        (SummaryPageConfigurationGroup.prototype.missingPlatforms): Added.
+        (SummaryPageConfigurationGroup.prototype.platformsWithoutBaseline): Added.
+        (SummaryPageConfigurationGroup.prototype._fetchAndComputeRatio):
+
+2016-05-13  Ryosuke Niwa  <[email protected]>
+
         Always use v3 UI for dashboards and analysis task pages
         https://bugs.webkit.org/show_bug.cgi?id=157647
 

Modified: trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js (200877 => 200878)


--- trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js	2016-05-13 19:42:22 UTC (rev 200877)
+++ trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js	2016-05-13 19:42:38 UTC (rev 200878)
@@ -40,13 +40,18 @@
     
     render()
     {
+        Instrumentation.startMeasuringTime('SummaryPage', 'render');
         super.render();
 
-        if (this._shouldConstructTable)
+        if (this._shouldConstructTable) {
+            Instrumentation.startMeasuringTime('SummaryPage', '_constructTable');
             this.renderReplace(this.content().querySelector('.summary-table'), this._constructTable());
+            Instrumentation.endMeasuringTime('SummaryPage', '_constructTable');
+        }
 
         for (var render of this._renderQueue)
             render();
+        Instrumentation.endMeasuringTime('SummaryPage', 'render');
     }
 
     _createConfigurationGroup(platformIdList, metricIdList)
@@ -90,38 +95,54 @@
         var element = ComponentBase.createElement;
         var link = ComponentBase.createLink;
         var configurationList = configurationGroup.configurationList();
-
         var ratioGraph = new RatioBarGraph();
 
-        var state = ChartsPage.createStateForConfigurationList(configurationList);
-
         if (configurationList.length == 0) {
             this._renderQueue.push(function () { ratioGraph.render(); });
             return element('td', ratioGraph);
         }
 
-        var cell = element('td');
-        var url = "" state);
-        this._renderQueue.push(function () {
-            if (configurationGroup.isFetching()) {
-                ComponentBase.renderReplace(cell, new SpinnerIcon);
-                return;
-            }
+        var state = ChartsPage.createStateForConfigurationList(configurationList);
+        var anchor = link(ratioGraph, this.router().url('charts', state));
+        var cell = element('td', [anchor, new SpinnerIcon]);
 
-            var warnings = configurationGroup.warnings();
-            var warningText = '';
-            for (var type in warnings) {
-                var platformString = Array.from(warnings[type]).map(function (platform) { return platform.name(); }).join(', ');
-                warningText += `Missing ${type} for following platform(s): ${platformString}`;
-            }
+        this._renderQueue.push(this._renderCell.bind(this, cell, anchor, ratioGraph, configurationGroup));
+        return cell;
+    }
 
-            ComponentBase.renderReplace(cell, link(ratioGraph, warningText || 'Open charts', url));
+    _renderCell(cell, anchor, ratioGraph, configurationGroup)
+    {
+        if (configurationGroup.isFetching())
+            cell.classList.add('fetching');
+        else
+            cell.classList.remove('fetching');
 
-            ratioGraph.update(configurationGroup.ratio(), configurationGroup.label(), !!warningText);
-            ratioGraph.render();
-        });
+        var warningText = this._warningTextForGroup(configurationGroup);
+        anchor.title = warningText || 'Open charts';
+        ratioGraph.update(configurationGroup.ratio(), configurationGroup.label(), !!warningText);
+        ratioGraph.render();
+    }
 
-        return cell;
+    _warningTextForGroup(configurationGroup)
+    {
+        function mapAndSortByName(platforms)
+        {
+            return platforms && platforms.map(function (platform) { return platform.name(); }).sort();
+        }
+
+        function pluralizeIfNeeded(singularWord, platforms) { return singularWord + (platforms.length > 1 ? 's' : ''); }
+
+        var warnings = [];
+
+        var missingPlatforms = mapAndSortByName(configurationGroup.missingPlatforms());
+        if (missingPlatforms)
+            warnings.push(`Missing ${pluralizeIfNeeded('platform', missingPlatforms)}: ${missingPlatforms.join(', ')}`);
+
+        var platformsWithoutBaselines = mapAndSortByName(configurationGroup.platformsWithoutBaseline());
+        if (platformsWithoutBaselines)
+            warnings.push(`Need ${pluralizeIfNeeded('baseline', platformsWithoutBaselines)}: ${platformsWithoutBaselines.join(', ')}`);
+
+        return warnings.length ? warnings.join('\n') : null;
     }
 
     static htmlTemplate()
@@ -196,6 +217,14 @@
                 left: calc(50% - 1rem);
                 z-index: 100;
             }
+
+            .summary-table td.fetching a {
+                display: none;
+            }
+
+            .summary-table td:not(.fetching) spinner-icon {
+                display: none;
+            }
         `;
     }
 }
@@ -208,12 +237,14 @@
         this._setToRatio = new Map;
         this._ratio = null;
         this._label = null;
-        this._warnings = {};
+        this._missingPlatforms = new Set;
+        this._platformsWithoutBaseline = new Set;
         this._isFetching = false;
         this._smallerIsBetter = metrics.length ? metrics[0].isSmallerBetter() : null;
 
         for (var platform of platforms) {
             console.assert(platform instanceof Platform);
+            var foundInSomeMetric = false;
             for (var metric of metrics) {
                 console.assert(metric instanceof Metric);
                 console.assert(this._smallerIsBetter == metric.isSmallerBetter());
@@ -221,20 +252,24 @@
 
                 if (excludedConfigurations && platform.id() in excludedConfigurations && excludedConfigurations[platform.id()].includes(+metric.id()))
                     continue;
-                if (platform.hasMetric(metric)) {
-                    this._measurementSets.push(MeasurementSet.findSet(platform.id(), metric.id(), platform.lastModified(metric)));
-                    this._configurationList.push([platform.id(), metric.id()]);
-                }
+                if (!platform.hasMetric(metric))
+                    continue;
+                foundInSomeMetric = true;
+                this._measurementSets.push(MeasurementSet.findSet(platform.id(), metric.id(), platform.lastModified(metric)));
+                this._configurationList.push([platform.id(), metric.id()]);
             }
+            if (!foundInSomeMetric)
+                this._missingPlatforms.add(platform);
         }
     }
 
     ratio() { return this._ratio; }
     label() { return this._label; }
-    warnings() { return this._warnings; }
     changeType() { return this._changeType; }
     configurationList() { return this._configurationList; }
     isFetching() { return this._isFetching; }
+    missingPlatforms() { return this._missingPlatforms.size ? Array.from(this._missingPlatforms) : null; }
+    platformsWithoutBaseline() { return this._platformsWithoutBaseline.size ? Array.from(this._platformsWithoutBaseline) : null; }
 
     fetchAndComputeSummary(timeRange)
     {
@@ -294,16 +329,10 @@
             var baselineMedian = SummaryPageConfigurationGroup._medianForTimeRange(baselineTimeSeries, timeRange);
             var currentMedian = SummaryPageConfigurationGroup._medianForTimeRange(currentTimeSeries, timeRange);
             var platform = Platform.findById(set.platformId());
-            if (!baselineMedian) {
-                if(!('baseline' in self._warnings))
-                    self._warnings['baseline'] = new Set;
-                self._warnings['baseline'].add(platform);
-            }
-            if (!currentMedian) {
-                if(!('current' in self._warnings))
-                    self._warnings['current'] = new Set;
-                self._warnings['current'].add(platform);
-            }
+            if (!currentMedian)
+                self._missingPlatforms.add(platform);
+            else if (!baselineMedian)
+                self._platformsWithoutBaseline.add(platform);
 
             setToRatio.set(set, currentMedian / baselineMedian);
         }).catch(function () {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to