<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200878] trunk/Websites/perf.webkit.org</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200878">200878</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-13 12:42:38 -0700 (Fri, 13 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv3pagessummarypagejs">trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsitesperfwebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/ChangeLog (200877 => 200878)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2016-05-13  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        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  &lt;rniwa@webkit.org&gt;
+
</ins><span class="cx">         Always use v3 UI for dashboards and analysis task pages
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=157647
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv3pagessummarypagejs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v3/pages/summary-page.js (200877 => 200878)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -40,13 +40,18 @@
</span><span class="cx">     
</span><span class="cx">     render()
</span><span class="cx">     {
</span><ins>+        Instrumentation.startMeasuringTime('SummaryPage', 'render');
</ins><span class="cx">         super.render();
</span><span class="cx"> 
</span><del>-        if (this._shouldConstructTable)
</del><ins>+        if (this._shouldConstructTable) {
+            Instrumentation.startMeasuringTime('SummaryPage', '_constructTable');
</ins><span class="cx">             this.renderReplace(this.content().querySelector('.summary-table'), this._constructTable());
</span><ins>+            Instrumentation.endMeasuringTime('SummaryPage', '_constructTable');
+        }
</ins><span class="cx"> 
</span><span class="cx">         for (var render of this._renderQueue)
</span><span class="cx">             render();
</span><ins>+        Instrumentation.endMeasuringTime('SummaryPage', 'render');
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _createConfigurationGroup(platformIdList, metricIdList)
</span><span class="lines">@@ -90,38 +95,54 @@
</span><span class="cx">         var element = ComponentBase.createElement;
</span><span class="cx">         var link = ComponentBase.createLink;
</span><span class="cx">         var configurationList = configurationGroup.configurationList();
</span><del>-
</del><span class="cx">         var ratioGraph = new RatioBarGraph();
</span><span class="cx"> 
</span><del>-        var state = ChartsPage.createStateForConfigurationList(configurationList);
-
</del><span class="cx">         if (configurationList.length == 0) {
</span><span class="cx">             this._renderQueue.push(function () { ratioGraph.render(); });
</span><span class="cx">             return element('td', ratioGraph);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var cell = element('td');
-        var url = this.router().url('charts', state);
-        this._renderQueue.push(function () {
-            if (configurationGroup.isFetching()) {
-                ComponentBase.renderReplace(cell, new SpinnerIcon);
-                return;
-            }
</del><ins>+        var state = ChartsPage.createStateForConfigurationList(configurationList);
+        var anchor = link(ratioGraph, this.router().url('charts', state));
+        var cell = element('td', [anchor, new SpinnerIcon]);
</ins><span class="cx"> 
</span><del>-            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}`;
-            }
</del><ins>+        this._renderQueue.push(this._renderCell.bind(this, cell, anchor, ratioGraph, configurationGroup));
+        return cell;
+    }
</ins><span class="cx"> 
</span><del>-            ComponentBase.renderReplace(cell, link(ratioGraph, warningText || 'Open charts', url));
</del><ins>+    _renderCell(cell, anchor, ratioGraph, configurationGroup)
+    {
+        if (configurationGroup.isFetching())
+            cell.classList.add('fetching');
+        else
+            cell.classList.remove('fetching');
</ins><span class="cx"> 
</span><del>-            ratioGraph.update(configurationGroup.ratio(), configurationGroup.label(), !!warningText);
-            ratioGraph.render();
-        });
</del><ins>+        var warningText = this._warningTextForGroup(configurationGroup);
+        anchor.title = warningText || 'Open charts';
+        ratioGraph.update(configurationGroup.ratio(), configurationGroup.label(), !!warningText);
+        ratioGraph.render();
+    }
</ins><span class="cx"> 
</span><del>-        return cell;
</del><ins>+    _warningTextForGroup(configurationGroup)
+    {
+        function mapAndSortByName(platforms)
+        {
+            return platforms &amp;&amp; platforms.map(function (platform) { return platform.name(); }).sort();
+        }
+
+        function pluralizeIfNeeded(singularWord, platforms) { return singularWord + (platforms.length &gt; 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;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static htmlTemplate()
</span><span class="lines">@@ -196,6 +217,14 @@
</span><span class="cx">                 left: calc(50% - 1rem);
</span><span class="cx">                 z-index: 100;
</span><span class="cx">             }
</span><ins>+
+            .summary-table td.fetching a {
+                display: none;
+            }
+
+            .summary-table td:not(.fetching) spinner-icon {
+                display: none;
+            }
</ins><span class="cx">         `;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -208,12 +237,14 @@
</span><span class="cx">         this._setToRatio = new Map;
</span><span class="cx">         this._ratio = null;
</span><span class="cx">         this._label = null;
</span><del>-        this._warnings = {};
</del><ins>+        this._missingPlatforms = new Set;
+        this._platformsWithoutBaseline = new Set;
</ins><span class="cx">         this._isFetching = false;
</span><span class="cx">         this._smallerIsBetter = metrics.length ? metrics[0].isSmallerBetter() : null;
</span><span class="cx"> 
</span><span class="cx">         for (var platform of platforms) {
</span><span class="cx">             console.assert(platform instanceof Platform);
</span><ins>+            var foundInSomeMetric = false;
</ins><span class="cx">             for (var metric of metrics) {
</span><span class="cx">                 console.assert(metric instanceof Metric);
</span><span class="cx">                 console.assert(this._smallerIsBetter == metric.isSmallerBetter());
</span><span class="lines">@@ -221,20 +252,24 @@
</span><span class="cx"> 
</span><span class="cx">                 if (excludedConfigurations &amp;&amp; platform.id() in excludedConfigurations &amp;&amp; excludedConfigurations[platform.id()].includes(+metric.id()))
</span><span class="cx">                     continue;
</span><del>-                if (platform.hasMetric(metric)) {
-                    this._measurementSets.push(MeasurementSet.findSet(platform.id(), metric.id(), platform.lastModified(metric)));
-                    this._configurationList.push([platform.id(), metric.id()]);
-                }
</del><ins>+                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()]);
</ins><span class="cx">             }
</span><ins>+            if (!foundInSomeMetric)
+                this._missingPlatforms.add(platform);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ratio() { return this._ratio; }
</span><span class="cx">     label() { return this._label; }
</span><del>-    warnings() { return this._warnings; }
</del><span class="cx">     changeType() { return this._changeType; }
</span><span class="cx">     configurationList() { return this._configurationList; }
</span><span class="cx">     isFetching() { return this._isFetching; }
</span><ins>+    missingPlatforms() { return this._missingPlatforms.size ? Array.from(this._missingPlatforms) : null; }
+    platformsWithoutBaseline() { return this._platformsWithoutBaseline.size ? Array.from(this._platformsWithoutBaseline) : null; }
</ins><span class="cx"> 
</span><span class="cx">     fetchAndComputeSummary(timeRange)
</span><span class="cx">     {
</span><span class="lines">@@ -294,16 +329,10 @@
</span><span class="cx">             var baselineMedian = SummaryPageConfigurationGroup._medianForTimeRange(baselineTimeSeries, timeRange);
</span><span class="cx">             var currentMedian = SummaryPageConfigurationGroup._medianForTimeRange(currentTimeSeries, timeRange);
</span><span class="cx">             var platform = Platform.findById(set.platformId());
</span><del>-            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);
-            }
</del><ins>+            if (!currentMedian)
+                self._missingPlatforms.add(platform);
+            else if (!baselineMedian)
+                self._platformsWithoutBaseline.add(platform);
</ins><span class="cx"> 
</span><span class="cx">             setToRatio.set(set, currentMedian / baselineMedian);
</span><span class="cx">         }).catch(function () {
</span></span></pre>
</div>
</div>

</body>
</html>