<!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>[174622] trunk/Tools</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/174622">174622</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-10-10 16:29:52 -0700 (Fri, 10 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Dashboard metrics page should have EWS statistics
https://bugs.webkit.org/show_bug.cgi?id=137626
Reviewed by Ryosuke Niwa.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js:
(BubbleQueue): Put shortName in the object, so that it's actually useful.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer): Re-ordered queues to match bubble order.
(BubbleQueueServer.prototype.jsonProcessingTimesURL): Added URL for the new handler.
(BubbleQueueServer.prototype.loadProcessingTimes): Load the data from webkit-queues.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
Added analysis for bubble queues.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js:
(buildBubbleQueuesTable): Build the UI.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html:
Added JS sources to load.
* QueueStatusServer/app.yaml: To update app version.
* QueueStatusServer/handlers/processingtimesjson.py: Added.
* QueueStatusServer/main.py: Added a handler for processing-times-json.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueuejs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueueServerjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsAnalyzerjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsMainjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js</a></li>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardmetricshtml">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsQueueStatusServerappyaml">trunk/Tools/QueueStatusServer/app.yaml</a></li>
<li><a href="#trunkToolsQueueStatusServermainpy">trunk/Tools/QueueStatusServer/main.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsBubbleViewjs">trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js</a></li>
<li><a href="#trunkToolsQueueStatusServerhandlersprocessingtimesjsonpy">trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueuejs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx">
</span><span class="cx"> this.queueServer = queueServer;
</span><span class="cx"> this.id = id;
</span><ins>+ this.shortName = info.shortName || id;
</ins><span class="cx"> this.title = info.title || "\xa0";
</span><span class="cx">
</span><span class="cx"> this.platform = info.platform ? info.platform.name : "unknown";
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsBubbleQueueServerjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -28,10 +28,10 @@
</span><span class="cx"> const queueInfo = {
</span><span class="cx"> "commit-queue": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "commit", title: "Commit Queue"},
</span><span class="cx"> "style-queue": {shortName: "style", title: "Style Checker Queue"},
</span><ins>+ "gtk-wk2-ews": {platform: Dashboard.Platform.LinuxGTK, shortName: "gtk-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"},
</ins><span class="cx"> "mac-ews": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "mac", title: "WebKit1\xa0Release\xa0Tests\xa0EWS"},
</span><span class="cx"> "mac-wk2-ews": {platform: Dashboard.Platform.MacOSXMountainLion, shortName: "mac-wk2", title: "WebKit2\xa0Release\xa0Tests\xa0EWS"},
</span><span class="cx"> "win-ews": {platform: Dashboard.Platform.Windows7, shortName: "win", title: "WebKit1\xa0Release\xa0Build\xa0EWS"},
</span><del>- "gtk-wk2-ews": {platform: Dashboard.Platform.LinuxGTK, shortName: "gtk-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"},
</del><span class="cx"> "efl-wk2-ews": {platform: Dashboard.Platform.LinuxEFL, shortName: "efl-wk2", title: "WebKit2\xa0Release\xa0Build\xa0EWS"}
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -60,8 +60,39 @@
</span><span class="cx"> return this.baseURL + "queue-status-json/" + encodeURIComponent(queueID);
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ jsonProcessingTimesURL: function(fromTime, toTime)
+ {
+ return this.baseURL + "processing-times-json/" + [fromTime.getUTCFullYear(), fromTime.getUTCMonth() + 1, fromTime.getUTCDate(), fromTime.getUTCHours(), fromTime.getUTCMinutes(), fromTime.getUTCSeconds()].join("-")
+ + "-" + [toTime.getUTCFullYear(), toTime.getUTCMonth() + 1, toTime.getUTCDate(), toTime.getUTCHours(), toTime.getUTCMinutes(), toTime.getUTCSeconds()].join("-");
+ },
+
</ins><span class="cx"> queueStatusURL: function(queueID)
</span><span class="cx"> {
</span><span class="cx"> return this.baseURL + "queue-status/" + encodeURIComponent(queueID);
</span><span class="cx"> },
</span><ins>+
+ // Retrieves information about all patches that were submitted in the time range:
+ // {
+ // patch_id_1: {
+ // queue_name_1: {
+ // date: <date/time when the patch was submitted to the queue>,
+ // retry_count: <number of times a bot had to bail out and drop the lock, for another bot to start from scratch>,
+ // wait_duration: <how long it took before a bot first locked the patch for processing>,
+ // process_duration: <how long it took from end of wait to finish, only valid for finished patches. Includes wait time between retries>
+ // final_message: <(pass|fail|not processed|could not apply|internal error|in progress)>
+ // },
+ // ...
+ // },
+ // ...
+ // }
+ loadProcessingTimes: function(fromTime, toTime, callback)
+ {
+ JSON.load(this.jsonProcessingTimesURL(fromTime, toTime), function(data) {
+ for (patch in data) {
+ for (queue in patch)
+ queue.date = new Date(queue.date);
+ }
+ callback(data, fromTime, toTime);
+ }.bind(this));
+ },
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsAnalyzerjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx"> }, this);
</span><span class="cx">
</span><span class="cx"> webkitTrac.load(this._rangeStartTime, this._rangeEndTime);
</span><ins>+
+ bubbleQueueServer.loadProcessingTimes(this._rangeStartTime, this._rangeEndTime, this._loadedBubblesTiming.bind(this));
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _triggeringQueue: function(queue)
</span><span class="lines">@@ -380,5 +382,117 @@
</span><span class="cx">
</span><span class="cx"> if (this._hasTracData)
</span><span class="cx"> this._analyze();
</span><del>- }
</del><ins>+ },
+
+ _analyzeBubblePerformance: function(queueID, patches)
+ {
+ var patchesThatCausedInternalError = [];
+ for (patchID in patches) {
+ if (patches[patchID].resolution === "internal error")
+ patchesThatCausedInternalError.push(patchID);
+ }
+
+ var waitTimes = [];
+ var totalTimes = [];
+ var totalTimesForPatchesThatWereNotRetried = [];
+ var totalTimesForPatchesThatSpinnedAndPassedOrFailed = [];
+ var patchesThatDidNotComplete = [];
+ var retryCounts = [];
+ var patchesThatSpinnedAndDidNotComplete = [];
+ var patchesThatSpinnedAndCeasedToApply = [];
+ var patchesThatSpinnedAndPassedOrFailed = [];
+ var patchesDidNotApply = [];
+ for (patchID in patches) {
+ var patch = patches[patchID];
+
+ // Wait time is equally interesting for all patches.
+ waitTimes.push(patch.wait_duration);
+
+ if (patch.resolution === "not processed")
+ patchesThatDidNotComplete.push(patchID);
+
+ if (patch.retry_count === 0)
+ totalTimesForPatchesThatWereNotRetried.push(patch.wait_duration + patch.process_duration);
+ else {
+ retryCounts.push(patch.retry_count);
+ if (patch.resolution === "not processed")
+ patchesThatSpinnedAndDidNotComplete.push(patchID);
+ else if (patch.resolution === "could not apply")
+ patchesThatSpinnedAndCeasedToApply.push(patchID);
+ else if (patch.resolution === "pass" || patch.resolution === "fail") {
+ patchesThatSpinnedAndPassedOrFailed.push(patchID);
+ totalTimesForPatchesThatSpinnedAndPassedOrFailed.push(patch.wait_duration + patch.process_duration);
+ }
+ }
+
+ // Analyze processing performance for patches that were definitely processed.
+ // We can't target improving performance of others (such as patches that were obsoleted while in the queue).
+ // Patches that don't apply to trunk have to be excluded, because otherwise we
+ // get times for patches that spinned until they ceased to apply.
+ if (patch.resolution === "pass" || patch.resolution === "fail")
+ totalTimes.push(patch.wait_duration + patch.process_duration);
+
+ if (patch.resolution === "could not apply")
+ patchesDidNotApply.push(patchID);
+ }
+
+ var result = {
+ queueID: queueID,
+ totalPatches: Object.keys(patches).length,
+ patchesThatDidNotCompleteCount: patchesThatDidNotComplete.length,
+ patchesWithRetriesCount: retryCounts.length,
+ patchesThatDidNotApplyCount: patchesDidNotApply.length,
+ patchesThatSpinnedAndDidNotCompleteCount: patchesThatSpinnedAndDidNotComplete.length,
+ patchesThatSpinnedAndCeasedToApplyCount: patchesThatSpinnedAndCeasedToApply.length,
+ patchesThatSpinnedAndPassedOrFailedCount: patchesThatSpinnedAndPassedOrFailed.length,
+ medianTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds: totalTimesForPatchesThatSpinnedAndPassedOrFailed.median(),
+ averageTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds: totalTimesForPatchesThatSpinnedAndPassedOrFailed.average(),
+ medianWaitTimeInSeconds: waitTimes.median(),
+ averageWaitTimeInSeconds: waitTimes.average(),
+ patchesThatCausedInternalError: patchesThatCausedInternalError,
+ };
+
+ if (totalTimes.length) {
+ result.medianTotalTimeInSeconds = totalTimes.median();
+ result.averageTotalTimeInSeconds = totalTimes.average();
+ }
+
+ if (totalTimesForPatchesThatWereNotRetried.length) {
+ result.medianTotalTimeForPatchesThatWereNotRetriedInSeconds = totalTimesForPatchesThatWereNotRetried.median();
+ result.averageTotalTimeForPatchesThatWereNotRetriedInSeconds = totalTimesForPatchesThatWereNotRetried.average();
+ }
+
+ this.dispatchEventToListeners(Analyzer.Event.QueueResults, result);
+ },
+
+ _analyzeAllBubblesPerformance: function(dataByPatch)
+ {
+ var data = {};
+ for (queueID in bubbleQueueServer.queues)
+ data[queueID] = {};
+
+ for (patchID in dataByPatch) {
+ for (queueID in dataByPatch[patchID]) {
+ if (!queueID in data)
+ continue;
+ var patchData = dataByPatch[patchID][queueID];
+ if (patchData.date < this.fromDate || patchData.date > this.toDate)
+ continue;
+ if (patchData.resolution === "in progress")
+ continue;
+ data[queueID][patchID] = patchData;
+ };
+ };
+ for (queueID in data)
+ this._analyzeBubblePerformance(queueID, data[queueID]);
+ },
+
+ _loadedBubblesTiming: function(data, fromTime, toTime)
+ {
+ // Only analyze if the data covers the latest range requested by the user.
+ // It may be different from the loaded one if the user quickly requested multiple ranges.
+ if (fromTime > this._rangeStartTime || toTime < this._rangeEndTime)
+ return;
+ this._analyzeAllBubblesPerformance(data);
+ },
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsBubbleViewjs"></a>
<div class="addfile"><h4>Added: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js (0 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js         (rev 0)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+MetricsBubbleView = function(analyzer, queue)
+{
+ BaseObject.call(this);
+
+ this.element = document.createElement("div");
+ this.element.classList.add("queue-view");
+
+ this._results = null;
+
+ this._queue = queue;
+
+ analyzer.addEventListener(Analyzer.Event.Starting, this._clearResults, this);
+ analyzer.addEventListener(Analyzer.Event.QueueResults, this._queueResultsAdded, this);
+
+ this._updateSoon();
+};
+
+MetricsBubbleView.UpdateSoonTimeout = 100; // 100 ms
+
+BaseObject.addConstructorFunctions(MetricsBubbleView);
+
+MetricsBubbleView.prototype = {
+ constructor: MetricsBubbleView,
+ __proto__: BaseObject.prototype,
+
+ _clearResults: function()
+ {
+ this._results = null;
+ this._updateSoon();
+ },
+
+ _queueResultsAdded: function(event)
+ {
+ if (this._queue.id !== event.data.queueID)
+ return;
+
+ this._results = event.data;
+ this._updateSoon();
+ },
+
+ _update: function()
+ {
+ this.element.removeChildren();
+
+ function addLine(element, text)
+ {
+ var line = document.createElement("div");
+ line.textContent = text;
+ line.classList.add("result-line");
+ element.appendChild(line);
+ }
+
+ function addError(element, text)
+ {
+ addLine(element, text);
+ element.lastChild.classList.add("error-line");
+ }
+
+ function addDivider(element)
+ {
+ var divider = document.createElement("div");
+ divider.classList.add("divider");
+ element.appendChild(divider);
+ }
+
+ function pluralizeMinutes(intervalInSeconds)
+ {
+ if (intervalInSeconds < 60)
+ return "less than a minute";
+ else if (intervalInSeconds < 120)
+ return "1\xa0minute";
+ else
+ return Math.round(intervalInSeconds / 60) + "\xa0minutes";
+ }
+
+ function formatPercentage(fraction)
+ {
+ if (fraction > 0 && fraction < 0.01)
+ return "< 1%";
+ else
+ return Math.round(fraction * 100) + "%";
+ }
+
+ if (!this._results)
+ return;
+
+ if (this._queue.id === "style-queue") {
+ addDivider(this.element);
+ addLine(this.element, "Time to result:");
+ addLine(this.element, "- median: " + pluralizeMinutes(this._results.medianTotalTimeInSeconds) + ";");
+ addLine(this.element, "- average: " + pluralizeMinutes(this._results.averageTotalTimeInSeconds) + ".");
+ } else {
+ if (this._results.totalPatches !== this._results.patchesWithRetriesCount) {
+ addDivider(this.element);
+ var numberOfPatchesThatHadFinalResultsAtFirstTry = this._results.totalPatches - this._results.patchesWithRetriesCount - this._results.patchesThatDidNotCompleteCount + this._results.patchesThatSpinnedAndDidNotCompleteCount;
+ var text = formatPercentage(numberOfPatchesThatHadFinalResultsAtFirstTry / this._results.totalPatches) + " of patches ";
+ text += (this._queue.id === "commit-queue") ? "were landed or rejected" : "had final results";
+ text += " at first try. Time to result:"
+ addLine(this.element, text);
+ addLine(this.element, "- median: " + pluralizeMinutes(this._results.medianTotalTimeForPatchesThatWereNotRetriedInSeconds) + ";");
+ addLine(this.element, "- average: " + pluralizeMinutes(this._results.averageTotalTimeForPatchesThatWereNotRetriedInSeconds) + ".");
+ if (this._results.patchesThatDidNotApplyCount !== this._results.patchesThatSpinnedAndCeasedToApplyCount) {
+ if (this._results.patchesThatDidNotApplyCount - this._results.patchesThatSpinnedAndCeasedToApplyCount === numberOfPatchesThatHadFinalResultsAtFirstTry)
+ addLine(this.element, "None of these applied to trunk.");
+ else
+ addLine(this.element, "This includes " + formatPercentage((this._results.patchesThatDidNotApplyCount - this._results.patchesThatSpinnedAndCeasedToApplyCount) / this._results.totalPatches) + " that did not apply to trunk.");
+ }
+ }
+
+ if (this._results.patchesThatDidNotCompleteCount !== this._results.patchesThatSpinnedAndDidNotCompleteCount) {
+ addDivider(this.element);
+ addLine(this.element, formatPercentage((this._results.patchesThatDidNotCompleteCount - this._results.patchesThatSpinnedAndDidNotCompleteCount) / this._results.totalPatches) + " of patches ceased to be eligible for processing before the first try finished.");
+ }
+
+ if (this._results.patchesWithRetriesCount) {
+ addDivider(this.element);
+ var text = formatPercentage(this._results.patchesWithRetriesCount / this._results.totalPatches) + " of patches had to be retried";
+ if (this._results.patchesThatSpinnedAndDidNotCompleteCount) {
+ text += ", including " + formatPercentage(this._results.patchesThatSpinnedAndDidNotCompleteCount / this._results.totalPatches) + " that kept being retried until the patch became ineligible for processing";
+ if (this._results.patchesThatSpinnedAndCeasedToApplyCount)
+ text += ", and " + formatPercentage(this._results.patchesThatSpinnedAndCeasedToApplyCount / this._results.totalPatches) + " that kept being retried until the patch ceased to apply to trunk.";
+ else
+ text += ".";
+ } else if (this._results.patchesThatSpinnedAndCeasedToApplyCount)
+ text += ", including " + formatPercentage(this._results.patchesThatSpinnedAndCeasedToApplyCount / this._results.totalPatches) + " that were spinning until the patch ceased to apply to trunk.";
+ else
+ text += ".";
+ if (this._results.patchesThatSpinnedAndPassedOrFailedCount) {
+ text += (this._results.patchesWithRetriesCount === this._results.patchesThatSpinnedAndPassedOrFailedCount) ? " All of them" : " " + formatPercentage(this._results.patchesThatSpinnedAndPassedOrFailedCount / this._results.totalPatches);
+ text += " finally produced a result, which took:";
+ addLine(this.element, text);
+ addLine(this.element, "- median: " + pluralizeMinutes(this._results.medianTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds) + ";");
+ addLine(this.element, "- average: " + pluralizeMinutes(this._results.averageTotalTimeForPatchesThatSpinnedAndPassedOrFailedInSeconds) + ".");
+ } else
+ addLine(this.element, text);
+ }
+ }
+
+ addDivider(this.element);
+ addLine(this.element, "Median wait time before processing started: " + pluralizeMinutes(this._results.medianWaitTimeInSeconds) + ".");
+
+ if (this._results.patchesThatCausedInternalError.length) {
+ addDivider(this.element);
+ if (this._results.patchesThatCausedInternalError.length === 1)
+ addError(this.element, "One patch caused internal error");
+ else
+ addError(this.element, this._results.patchesThatCausedInternalError.length + "\xa0patches caused internal error, please see patch numbers in console log.");
+ console.log("Patches that caused internal error for " + this._results.queueID + ": " + this._results.patchesThatCausedInternalError);
+ }
+ },
+
+ _updateSoon: function()
+ {
+ setTimeout(this._update.bind(this), MetricsBubbleView.UpdateSoonTimeout);
+ },
+};
</ins><span class="cx">Property changes on: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardScriptsMetricsMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+var hasBubbles = typeof bubbleQueueServer != "undefined";
+
</ins><span class="cx"> var analyzer = new Analyzer;
</span><span class="cx">
</span><span class="cx"> var allBuilderResultsPseudoQueue = { id: "allBuilderResultsPseudoQueue" };
</span><span class="lines">@@ -260,6 +262,39 @@
</span><span class="cx"> return table;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function buildBubbleQueuesTable()
+{
+ var table = document.createElement("table");
+ table.classList.add("queue-grid");
+
+ var row = document.createElement("tr");
+ row.classList.add("headers");
+
+ for (id in bubbleQueueServer.queues) {
+ var header = document.createElement("th");
+ header.textContent = bubbleQueueServer.queues[id].shortName;
+ row.appendChild(header);
+ }
+
+ table.appendChild(row);
+
+ row = document.createElement("tr");
+ row.classList.add("platform");
+
+ for (id in bubbleQueueServer.queues) {
+ var cell = document.createElement("td");
+ var view = new MetricsBubbleView(analyzer, bubbleQueueServer.queues[id]);
+ cell.appendChild(view.element);
+ row.appendChild(cell);
+ }
+
+ table.appendChild(row);
+
+ document.body.appendChild(table);
+
+ return table;
+}
+
</ins><span class="cx"> function documentReady()
</span><span class="cx"> {
</span><span class="cx"> var rangePicker = document.createElement("span");
</span><span class="lines">@@ -302,6 +337,12 @@
</span><span class="cx"> }, this);
</span><span class="cx">
</span><span class="cx"> buildAggregateTable();
</span><ins>+ if (hasBubbles) {
+ var tablesDivider = document.createElement("div");
+ tablesDivider.classList.add("tables-divider");
+ document.body.appendChild(tablesDivider);
+ buildBubbleQueuesTable();
+ }
</ins><span class="cx">
</span><span class="cx"> var tablesDivider = document.createElement("div");
</span><span class="cx"> tablesDivider.classList.add("tables-divider");
</span></span></pre></div>
<a id="trunkToolsBuildSlaveSupportbuildwebkitorgconfigpublic_htmldashboardmetricshtml"></a>
<div class="modfile"><h4>Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -36,8 +36,10 @@
</span><span class="cx"> <script src="Scripts/BaseObject.js"></script>
</span><span class="cx"> <script src="Scripts/Dashboard.js"></script>
</span><span class="cx"> <script src="Scripts/Buildbot.js"></script>
</span><ins>+ <script src="Scripts/BubbleQueueServer.js"></script>
</ins><span class="cx"> <script src="Scripts/WebKitBuildbot.js"></script>
</span><span class="cx"> <script src="Scripts/BuildbotQueue.js"></script>
</span><ins>+ <script src="Scripts/BubbleQueue.js"></script>
</ins><span class="cx"> <script src="Scripts/BuildbotIteration.js"></script>
</span><span class="cx"> <script src="Scripts/BuildbotTestResults.js"></script>
</span><span class="cx"> <script src="Scripts/Settings.js"></script>
</span><span class="lines">@@ -45,6 +47,7 @@
</span><span class="cx"> <script src="Scripts/Initialization.js"></script>
</span><span class="cx"> <script src="Scripts/MetricsAnalyzer.js"></script>
</span><span class="cx"> <script src="Scripts/MetricsView.js"></script>
</span><ins>+ <script src="Scripts/MetricsBubbleView.js"></script>
</ins><span class="cx"> <script src="External/jquery-1.11.1.min.js"></script>
</span><span class="cx"> <script src="External/moment.min.js"></script>
</span><span class="cx"> <script src="External/jquery.daterangepicker.js"></script>
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/ChangeLog        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2014-10-10 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><ins>+ Dashboard metrics page should have EWS statistics
+ https://bugs.webkit.org/show_bug.cgi?id=137626
+
+ Reviewed by Ryosuke Niwa.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js:
+ (BubbleQueue): Put shortName in the object, so that it's actually useful.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
+ (BubbleQueueServer): Re-ordered queues to match bubble order.
+ (BubbleQueueServer.prototype.jsonProcessingTimesURL): Added URL for the new handler.
+ (BubbleQueueServer.prototype.loadProcessingTimes): Load the data from webkit-queues.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
+ Added analysis for bubble queues.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js: Added.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js:
+ (buildBubbleQueuesTable): Build the UI.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/metrics.html:
+ Added JS sources to load.
+
+ * QueueStatusServer/app.yaml: To update app version.
+
+ * QueueStatusServer/handlers/processingtimesjson.py: Added.
+
+ * QueueStatusServer/main.py: Added a handler for processing-times-json.
+
+2014-10-10 Alexey Proskuryakov <ap@apple.com>
+
</ins><span class="cx"> REGRESSION: Commit queue doesn't process rollouts
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=137623
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsQueueStatusServerappyaml"></a>
<div class="modfile"><h4>Modified: trunk/Tools/QueueStatusServer/app.yaml (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/QueueStatusServer/app.yaml        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/QueueStatusServer/app.yaml        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> application: webkit-queues
</span><del>-version: 174611 # SVN revision of last major change
</del><ins>+version: 174622 # SVN revision of last major change
</ins><span class="cx"> runtime: python
</span><span class="cx"> api_version: 1
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsQueueStatusServerhandlersprocessingtimesjsonpy"></a>
<div class="addfile"><h4>Added: trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py (0 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py         (rev 0)
+++ trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import datetime
+
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+from model.patchlog import PatchLog
+
+# Fall back to simplejson, because we are still on Python 2.5.
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
+
+class ProcessingTimesJSON(webapp.RequestHandler):
+ def _resultFromFinalStatus(self, status_message, queue_name):
+ if status_message == "Pass":
+ return "pass"
+ elif status_message == "Fail":
+ return "fail"
+ elif status_message == "Error: " + queue_name + " did not process patch.":
+ return "not processed"
+ elif status_message == "Error: " + queue_name + " unable to apply patch.":
+ return "could not apply"
+ else:
+ return "internal error"
+
+ def _fetch_patch_log(self, start_date, end_date):
+ all_entries = PatchLog.all().filter('date >', start_date).filter('date <', end_date).fetch(limit=None)
+ result = {}
+ for entry in all_entries:
+ result.setdefault(entry.attachment_id, {})
+ result[entry.attachment_id][entry.queue_name] = {
+ "date": entry.date,
+ "wait_duration": entry.wait_duration,
+ "process_duration": entry.process_duration,
+ "retry_count": entry.retry_count,
+ "resolution": self._resultFromFinalStatus(entry.latest_message, entry.queue_name) if entry.finished else "in progress"
+ }
+ return result
+
+ def get(self, start_year, start_month, start_day, start_hour, start_minute, start_second, end_year, end_month, end_day, end_hour, end_minute, end_second):
+ self.response.headers["Access-Control-Allow-Origin"] = "*"
+ self.response.headers['Content-Type'] = 'application/json'
+
+ patch_log = self._fetch_patch_log(datetime.datetime(int(start_year), int(start_month), int(start_day), int(start_hour), int(start_minute), int(start_second)),
+ datetime.datetime(int(end_year), int(end_month), int(end_day), int(end_hour), int(end_minute), int(end_second)))
+ dthandler = lambda obj: (obj.isoformat() + "Z") if isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date) else None
+ self.response.out.write(json.dumps(patch_log, default=dthandler))
</ins><span class="cx">Property changes on: trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkToolsQueueStatusServermainpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/QueueStatusServer/main.py (174621 => 174622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/QueueStatusServer/main.py        2014-10-10 23:24:38 UTC (rev 174621)
+++ trunk/Tools/QueueStatusServer/main.py        2014-10-10 23:29:52 UTC (rev 174622)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> # Copyright (C) 2009 Google Inc. All rights reserved.
</span><ins>+# Copyright (C) 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx"> from handlers.nextpatch import NextPatch
</span><span class="cx"> from handlers.patch import Patch
</span><span class="cx"> from handlers.patchstatus import PatchStatus
</span><ins>+from handlers.processingtimesjson import ProcessingTimesJSON
</ins><span class="cx"> from handlers.queuecharts import QueueCharts
</span><span class="cx"> from handlers.queuelengthjson import QueueLengthJSON
</span><span class="cx"> from handlers.queuestatus import QueueStatus
</span><span class="lines">@@ -79,6 +81,7 @@
</span><span class="cx"> ('/update-work-items', UpdateWorkItems),
</span><span class="cx"> ('/update-svn-revision', UpdateSVNRevision),
</span><span class="cx"> ('/active-bots', ActiveBots),
</span><ins>+ (r'/processing-times-json/(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)', ProcessingTimesJSON),
</ins><span class="cx"> ]
</span><span class="cx">
</span><span class="cx"> application = webapp.WSGIApplication(routes, debug=True)
</span></span></pre>
</div>
</div>
</body>
</html>