[prev in list] [next in list] [prev in thread] [next in thread]
List: webkit-changes
Subject: [webkit-changes] [224228] trunk/Websites/perf.webkit.org
From: dewei_zhu () apple ! com
Date: 2017-10-31 10:01:18
Message-ID: 20171031100118.85B8810051CA () svn ! webkit ! org
[Download RAW message or body]
[Attachment #2 (text/html)]
<!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>[224228] 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/224228">224228</a></dd> \
<dt>Author</dt> <dd>dewei_zhu@apple.com</dd> <dt>Date</dt> <dd>2017-10-31 03:01:18 \
-0700 (Tue, 31 Oct 2017)</dd> </dl>
<h3>Log Message</h3>
<pre>Limit the number of results to be submitted in one submission.
https://bugs.webkit.org/show_bug.cgi?id=179045
Reviewed by Ryosuke Niwa.
Submitting results for a large number of builds with owned commit information may \
exceed the size limit of php. Added a way to split the results into groups of certain \
sizes, and submit them one by one.
* server-tests/tools-os-build-fetcher-tests.js: Updated the unit tests.
* tools/js/os-build-fetcher.js: Added '_maxNumberOfResultsPerSubmit' which can be \
specified by a configuration but also use 20 as default value. \
(prototype.fetchAndReportNewBuilds): Instead of submitting all results once, split \
them into groups and submit them one by one. (prototype._fetchAvailableBuilds): \
'label' is already quoted, should remove unnecessary quotes. \
(prototype._addOwnedCommitsForBuild): Added logging to log the size of owned \
commits.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgserverteststoolsosbuildfetchertestsjs">trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgtoolsjsosbuildfetcherjs">trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.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 (224227 \
=> 224228)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog 2017-10-31 09:44:39 \
UTC (rev 224227)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2017-10-31 10:01:18 UTC (rev 224228)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-10-30 Dewei Zhu <dewei_zhu@apple.com>
+
+ Limit the number of results to be submitted in one submission.
+ https://bugs.webkit.org/show_bug.cgi?id=179045
+
+ Reviewed by Ryosuke Niwa.
+
+ Submitting results for a large number of builds with owned commit \
information may exceed the size limit of php. + Added a way to split the \
results into groups of certain sizes, and submit them one by one. +
+ * server-tests/tools-os-build-fetcher-tests.js: Updated the unit tests.
+ * tools/js/os-build-fetcher.js: Added '_maxNumberOfResultsPerSubmit' which \
can be specified by a configuration but also use 20 as default value. + \
(prototype.fetchAndReportNewBuilds): Instead of submitting all results once, split \
them into groups and submit them one by one. + \
(prototype._fetchAvailableBuilds): 'label' is already quoted, should remove \
unnecessary quotes. + (prototype._addOwnedCommitsForBuild): Added logging to \
log the size of owned commits. +
</ins><span class="cx"> 2017-10-31 Dewei Zhu <dewei_zhu@apple.com>
</span><span class="cx">
</span><span class="cx"> OwnedCommitViewer should include the preceding \
commit. </span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgserverteststoolsosbuildfetchertestsjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js (224227 \
=> 224228)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js 2017-10-31 \
09:44:39 UTC (rev 224227)
+++ trunk/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-tests.js 2017-10-31 \
10:01:18 UTC (rev 224228) </span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">
</span><span class="cx"> describe('OSBuilderFetcher._computeOrder', () => {
</span><span class="cx"> it('should calculate the right order for a given \
valid revision', () => { </span><del>- const fetcher = new \
OSBuildFetcher(); </del><ins>+ const fetcher = new OSBuildFetcher({});
</ins><span class="cx"> \
assert.equal(fetcher._computeOrder('Sierra16D32'), 1603003200); </span><span \
class="cx"> assert.equal(fetcher._computeOrder('16D321'), 1603032100); \
</span><span class="cx"> assert.equal(fetcher._computeOrder('16d321'), \
1603032100); </span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> it('should throw assertion error when given a \
invalid revision', () => { </span><del>- const fetcher = new \
OSBuildFetcher(); </del><ins>+ const fetcher = new OSBuildFetcher({});
</ins><span class="cx"> assert.throws(() => \
fetcher._computeOrder('invalid'), (error) => error.name == 'AssertionError'); \
</span><span class="cx"> assert.throws(() => \
fetcher._computeOrder(''), (error) => error.name == 'AssertionError'); \
</span><span class="cx"> assert.throws(() => \
fetcher._computeOrder('16'), (error) => error.name == 'AssertionError'); \
</span><span class="lines">@@ -124,7 +124,7 @@ </span><span class="cx"> \
describe('OSBuilderFetcher._commitsForAvailableBuilds', () => { </span><span \
class="cx"> it('should only return commits whose orders are higher than \
specified order', () => { </span><span class="cx"> const logger = new \
MockLogger; </span><del>- const fetchter = new OSBuildFetcher(null, null, \
null, MockSubprocess, logger); </del><ins>+ const fetchter = new \
OSBuildFetcher({}, null, null, MockSubprocess, logger); </ins><span class="cx"> \
const waitForInvocationPromise = MockSubprocess.waitForInvocation(); </span><span \
class="cx"> const fetchCommitsPromise = \
fetchter._commitsForAvailableBuilds('OSX', ['list', 'build1'], '^\\.*$', 1604000000); \
</span><span class="cx"> </span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> describe('OSBuildFetcher._addOwnedCommitsForBuild', () \
=> { </span><span class="cx"> it('should add owned-commit info for \
commits', () => { </span><span class="cx"> const logger = new \
MockLogger; </span><del>- const fetchter = new OSBuildFetcher(null, null, \
null, MockSubprocess, logger); </del><ins>+ const fetchter = new \
OSBuildFetcher({}, null, null, MockSubprocess, logger); </ins><span class="cx"> \
const waitForInvocationPromise = MockSubprocess.waitForInvocation(); </span><span \
class="cx"> const addownedCommitPromise = \
fetchter._addOwnedCommitsForBuild([osxCommit, anotherOSXCommit], ['ownedCommit', \
'for', 'revision']); </span><span class="cx">
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">
</span><span class="cx"> it('should fail if the command to get owned-commit \
info fails', () => { </span><span class="cx"> const logger = new \
MockLogger; </span><del>- const fetchter = new OSBuildFetcher(null, null, \
null, MockSubprocess, logger); </del><ins>+ const fetchter = new \
OSBuildFetcher({}, null, null, MockSubprocess, logger); </ins><span class="cx"> \
const waitForInvocationPromise = MockSubprocess.waitForInvocation(); </span><span \
class="cx"> const addownedCommitPromise = \
fetchter._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision']) \
</span><span class="cx"> </span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx">
</span><span class="cx"> it('should fail if entries in owned-commits does not \
contain revision', () => { </span><span class="cx"> const logger = new \
MockLogger; </span><del>- const fetchter = new OSBuildFetcher(null, null, \
null, MockSubprocess, logger); </del><ins>+ const fetchter = new \
OSBuildFetcher({}, null, null, MockSubprocess, logger); </ins><span class="cx"> \
const waitForInvocationPromise = MockSubprocess.waitForInvocation(); </span><span \
class="cx"> const addownedCommitPromise = \
fetchter._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision']) \
</span><span class="cx"> </span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">
</span><span class="cx"> assert.equal(webkitRepository.length, 1);
</span><span class="cx"> assert.equal(webkitRepository[0]['owner'], \
10); </span><del>- assert.equal(jscRepository.length, 1)
</del><ins>+ assert.equal(jscRepository.length, 1);
</ins><span class="cx"> assert.equal(jscRepository[0]['owner'], 10);
</span><span class="cx">
</span><span class="cx"> assert.equal(osxCommit16D69.length, 1);
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx"> const osxCommit16E34 = results[4];
</span><span class="cx">
</span><span class="cx"> assert.equal(webkitRepository.length, 0);
</span><del>- assert.equal(jscRepository.length, 0)
</del><ins>+ assert.equal(jscRepository.length, 0);
</ins><span class="cx">
</span><span class="cx"> assert.equal(osxCommit16D69.length, 1);
</span><span class="cx"> \
assert.equal(osxCommit16D69[0]['repository'], 10); </span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgtoolsjsosbuildfetcherjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js (224227 => 224228)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js 2017-10-31 09:44:39 UTC \
(rev 224227)
+++ trunk/Websites/perf.webkit.org/tools/js/os-build-fetcher.js 2017-10-31 10:01:18 \
UTC (rev 224228) </span><span class="lines">@@ -15,11 +15,11 @@
</span><span class="cx"> constructor(osConfig, remoteAPI, slaveAuth, subprocess, \
logger) </span><span class="cx"> {
</span><span class="cx"> this._osConfig = osConfig;
</span><del>- this._reportedRevisions = new Set();
</del><span class="cx"> this._logger = logger;
</span><span class="cx"> this._slaveAuth = slaveAuth;
</span><span class="cx"> this._remoteAPI = remoteAPI;
</span><span class="cx"> this._subprocess = subprocess;
</span><ins>+ this._maxSubmitCount = osConfig['maxSubmitCount'] || 20;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static fetchAndReportAllInOrder(fetcherList)
</span><span class="lines">@@ -31,7 +31,18 @@
</span><span class="cx"> {
</span><span class="cx"> return this._fetchAvailableBuilds().then((results) \
=> { </span><span class="cx"> this._logger.log(`Submitting \
${results.length} builds for ${this._osConfig['name']}`); </span><del>- \
return this._submitCommits(results); </del><ins>+ if (results.length == 0)
+ return this._submitCommits(results);
+
+ const splittedResults = [];
+ for (let startIndex = 0; startIndex < results.length; startIndex += \
this._maxSubmitCount) + splittedResults.push(results.slice(startIndex, \
startIndex + this._maxSubmitCount)); +
+ return mapInSerialPromiseChain(splittedResults, \
this._submitCommits.bind(this)).then((responses) => { + \
assert(responses.every((response) => response['status'] == 'OK')); + \
assert(responses.length > 0); + return responses[0];
+ });
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -53,11 +64,11 @@
</span><span class="cx"> const minOrder = result['commits'].length == \
1 ? parseInt(result['commits'][0]['order']) : 0; </span><span class="cx"> \
return this._commitsForAvailableBuilds(repositoryName, command['command'], \
command['linesToIgnore'], minOrder); </span><span class="cx"> \
}).then((commits) => { </span><del>- const label = 'name' in \
command ? `"${command['name']}"` : `"command['minRevision']" to \
"command['maxRevision']"`; </del><ins>+ const label = 'name' \
in command ? `"${command['name']}"` : \
`"${command['minRevision']}" to "${command['maxRevision']}"`; \
</ins><span class="cx"> this._logger.log(`Found ${commits.length} \
builds for ${label}`); </span><span class="cx">
</span><span class="cx"> if ('ownedCommitCommand' in command) {
</span><del>- this._logger.log(`Resolving ownedCommits for \
"${label}"`); </del><ins>+ this._logger.log(`Resolving \
ownedCommits for ${label}`); </ins><span class="cx"> return \
this._addOwnedCommitsForBuild(commits, command['ownedCommitCommand']); </span><span \
class="cx"> } </span><span class="cx">
</span><span class="lines">@@ -96,6 +107,7 @@
</span><span class="cx"> return mapInSerialPromiseChain(commits, (commit) \
=> { </span><span class="cx"> return \
this._subprocess.execute(command.concat(commit['revision'])).then((ownedCommitOutput) \
=> { </span><span class="cx"> const ownedCommits = \
JSON.parse(ownedCommitOutput); </span><ins>+ this._logger.log(`Got \
${Object.keys((ownedCommits)).length} owned commits for \
"${commit['revision']}"`); </ins><span class="cx"> for (let \
repositoryName in ownedCommits) { </span><span class="cx"> const \
ownedCommit = ownedCommits[repositoryName]; </span><span class="cx"> \
assert.deepEqual(Object.keys(ownedCommit), ['revision']); </span></span></pre>
</div>
</div>
</body>
</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic