<!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>[192760] 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/192760">192760</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-23 23:13:03 -0800 (Mon, 23 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/192716">r192716</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/192717">r192717</a>.
https://bugs.webkit.org/show_bug.cgi?id=151582

The patch was incorrect. We always need at least one data
point in each configuration (Requested by rniwa on #webkit).

Reverted changesets:

&quot;Perf dashboard's should not include results more than 366
days old in JSON&quot;
https://bugs.webkit.org/show_bug.cgi?id=151529
http://trac.webkit.org/changeset/192716

&quot;Build fix for old version of PHP.&quot;
http://trac.webkit.org/changeset/192717</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicapirunsphp">trunk/Websites/perf.webkit.org/public/api/runs.php</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 (192759 => 192760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog        2015-11-24 07:12:19 UTC (rev 192759)
+++ trunk/Websites/perf.webkit.org/ChangeLog        2015-11-24 07:13:03 UTC (rev 192760)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-11-23  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r192716 and r192717.
+        https://bugs.webkit.org/show_bug.cgi?id=151582
+
+        The patch was incorrect. We always need at least one data
+        point in each configuration (Requested by rniwa on #webkit).
+
+        Reverted changesets:
+
+        &quot;Perf dashboard's should not include results more than 366
+        days old in JSON&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=151529
+        http://trac.webkit.org/changeset/192716
+
+        &quot;Build fix for old version of PHP.&quot;
+        http://trac.webkit.org/changeset/192717
+
</ins><span class="cx"> 2015-11-20  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix for old version of PHP.
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicapirunsphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/api/runs.php (192759 => 192760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/api/runs.php        2015-11-24 07:12:19 UTC (rev 192759)
+++ trunk/Websites/perf.webkit.org/public/api/runs.php        2015-11-24 07:13:03 UTC (rev 192760)
</span><span class="lines">@@ -10,19 +10,10 @@
</span><span class="cx">     if (count($parts) != 2)
</span><span class="cx">         exit_with_error('InvalidRequest');
</span><span class="cx"> 
</span><del>-    $test_group_id = array_get($_GET, 'testGroup');
-    $should_cache = array_get($_GET, 'cache');
-    $should_echo_results = !array_key_exists('noResult', $_GET);
-
</del><span class="cx">     $db = new Database;
</span><span class="cx">     if (!$db-&gt;connect())
</span><span class="cx">         exit_with_error('DatabaseConnectionFailure');
</span><span class="cx"> 
</span><del>-    if ($test_group_id)
-        $generator = new RunsGeneratorForTestGroup($db, $test_group_id);
-    else
-        $generator = new RunsGenerator($db);
-
</del><span class="cx">     $platform_id = intval($parts[0]);
</span><span class="cx">     $metric_id = intval($parts[1]);
</span><span class="cx">     $config_rows = $db-&gt;query_and_fetch_all('SELECT *
</span><span class="lines">@@ -30,6 +21,8 @@
</span><span class="cx">     if (!$config_rows)
</span><span class="cx">         exit_with_error('ConfigurationNotFound');
</span><span class="cx"> 
</span><ins>+    $test_group_id = array_get($_GET, 'testGroup');
+    $should_cache = array_get($_GET, 'cache');
</ins><span class="cx">     if ($test_group_id)
</span><span class="cx">         $test_group_id = intval($test_group_id);
</span><span class="cx">     else if ($should_cache) { // Only v1 UI needs caching.
</span><span class="lines">@@ -38,16 +31,15 @@
</span><span class="cx">         header(&quot;Cache-Control: maxage=$maxage&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ($test_group_id)
+        $generator = new RunsGeneratorForTestGroup($db, $test_group_id);
+    else
+        $generator = new RunsGenerator($db);
+
</ins><span class="cx">     foreach ($config_rows as $config)
</span><span class="cx">         $generator-&gt;fetch_runs($config['config_type'], $config['config_id'], $config['config_runs_last_modified']);
</span><span class="cx"> 
</span><del>-    $results = $generator-&gt;results();
-    $content = success_json($results);
-    if (!$should_echo_results) {
-        echo $results['elapsedTime'];
-        return;
-    }
-
</del><ins>+    $content = success_json($generator-&gt;results());
</ins><span class="cx">     if (!$test_group_id)
</span><span class="cx">         generate_data_file(&quot;$platform_id-$metric_id.json&quot;, $content);
</span><span class="cx">     echo $content;
</span><span class="lines">@@ -71,19 +63,11 @@
</span><span class="cx">     function fetch_runs($name, $config_id, $last_modified) {
</span><span class="cx">         $this-&gt;last_modified = max($this-&gt;last_modified, Database::to_js_time($last_modified));
</span><span class="cx"> 
</span><del>-        $beginning_of_time = intval(time() - 366 * 24 * 3600) * 1000;
-
</del><span class="cx">         $results = $this-&gt;execute_query($config_id);
</span><span class="cx"> 
</span><span class="cx">         $formatted_runs = array();
</span><del>-        while ($row = $this-&gt;db-&gt;fetch_next_row($results)) {
-            $build_time = Database::to_js_time($row['build_time']);
-            $max_time = $build_time;
-            $revisions = self::parse_revisions_array($row['revisions'], $max_time);
-            if ($max_time &lt; $beginning_of_time)
-                continue;
-            array_push($formatted_runs, self::format_run($row, $build_time, $revisions));
-        }
</del><ins>+        while ($row = $this-&gt;db-&gt;fetch_next_row($results))
+            array_push($formatted_runs, self::format_run($row));
</ins><span class="cx"> 
</span><span class="cx">         $this-&gt;results[$name] = $formatted_runs;
</span><span class="cx">     }
</span><span class="lines">@@ -98,7 +82,7 @@
</span><span class="cx">                 GROUP BY build_id, run_id', array($config_id));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    private static function format_run($run, $build_time, $revisions) {
</del><ins>+    private static function format_run($run) {
</ins><span class="cx">         return array(
</span><span class="cx">             'id' =&gt; intval($run['run_id']),
</span><span class="cx">             'mean' =&gt; floatval($run['run_mean_cache']),
</span><span class="lines">@@ -106,14 +90,14 @@
</span><span class="cx">             'sum' =&gt; floatval($run['run_sum_cache']),
</span><span class="cx">             'squareSum' =&gt; floatval($run['run_square_sum_cache']),
</span><span class="cx">             'markedOutlier' =&gt; Database::is_true($run['run_marked_outlier']),
</span><del>-            'revisions' =&gt; $revisions,
</del><ins>+            'revisions' =&gt; self::parse_revisions_array($run['revisions']),
</ins><span class="cx">             'build' =&gt; $run['build_id'],
</span><del>-            'buildTime' =&gt; $build_time,
</del><ins>+            'buildTime' =&gt; Database::to_js_time($run['build_time']),
</ins><span class="cx">             'buildNumber' =&gt; intval($run['build_number']),
</span><span class="cx">             'builder' =&gt; $run['build_builder']);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    private static function parse_revisions_array($postgres_array, &amp;$max_time) {
</del><ins>+    private static function parse_revisions_array($postgres_array) {
</ins><span class="cx">         // e.g. {&quot;(WebKit,131456,\&quot;2012-10-16 14:53:00\&quot;)&quot;,&quot;(Chromium,162004,)&quot;}
</span><span class="cx">         $outer_array = json_decode('[' . trim($postgres_array, '{}') . ']');
</span><span class="cx">         $revisions = array();
</span><span class="lines">@@ -122,7 +106,6 @@
</span><span class="cx">             if (!$name_and_revision[0])
</span><span class="cx">                 continue;
</span><span class="cx">             $time = Database::to_js_time(trim($name_and_revision[2], '&quot;'));
</span><del>-            $max_time = max($max_time, $time);
</del><span class="cx">             $revisions[trim($name_and_revision[0], '&quot;')] = array(trim($name_and_revision[1], '&quot;'), $time);
</span><span class="cx">         }
</span><span class="cx">         return $revisions;
</span></span></pre>
</div>
</div>

</body>
</html>