<!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>[202000] 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/202000">202000</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-13 12:40:01 -0700 (Mon, 13 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>/admin/tests is very slow
https://bugs.webkit.org/show_bug.cgi?id=158682

Reviewed by Chris Dumez.

The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.

Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.

* public/admin/tests.php:
* public/include/test-name-resolver.php:
(TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
(TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
(TestNameResolver::test_exists_on_platform): Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicadmintestsphp">trunk/Websites/perf.webkit.org/public/admin/tests.php</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicincludetestnameresolverphp">trunk/Websites/perf.webkit.org/public/include/test-name-resolver.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 (201999 => 202000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog        2016-06-13 19:39:01 UTC (rev 201999)
+++ trunk/Websites/perf.webkit.org/ChangeLog        2016-06-13 19:40:01 UTC (rev 202000)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-06-13  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        /admin/tests is very slow
+        https://bugs.webkit.org/show_bug.cgi?id=158682
+
+        Reviewed by Chris Dumez.
+
+        The slowness came from TestNameResolver::__construct, which was fetching the entire table of test_configurations,
+        which at this point contains more than 32,000 rows. Don't fetch the entire table in the constructor. Instead,
+        fetch a subset of rows as needed in configurations_for_metric_and_platform. Even though this results in many SQL
+        queries being issued, that's a lot more efficient in practice because we only fetch a few dozen rows in practice.
+
+        Also removed a whole bunch of features from /admin/tests to simplify the page. In particular, the ability to update
+        the list of triggerables has been removed now that sync-buildbot.js automatically updates that for us. This removed
+        the last use of test_exists_on_platform, which was also dependent on fetching test_configurations upfront.
+
+        * public/admin/tests.php:
+        * public/include/test-name-resolver.php:
+        (TestNameResolver::__construct): Don't fetch the entire table of test_configurations.
+        (TestNameResolver::configurations_for_metric_and_platform): Just issue a SQL query for the specified platform and metric.
+        (TestNameResolver::test_exists_on_platform): Removed.
+
</ins><span class="cx"> 2016-06-08  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         sync-buildbot.js should update the list of tests and platforms associated with a triggerable
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicadmintestsphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/admin/tests.php (201999 => 202000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/admin/tests.php        2016-06-13 19:39:01 UTC (rev 201999)
+++ trunk/Websites/perf.webkit.org/public/admin/tests.php        2016-06-13 19:40:01 UTC (rev 202000)
</span><span class="lines">@@ -3,51 +3,9 @@
</span><span class="cx"> require_once('../include/admin-header.php');
</span><span class="cx"> require_once('../include/test-name-resolver.php');
</span><span class="cx"> 
</span><del>-if ($action == 'dashboard') {
-    if (array_key_exists('metric_id', $_POST)) {
-        $metric_id = intval($_POST['metric_id']);
-        $config_ids = array();
-        $succeeded = TRUE;
-        if (!$db-&gt;query_and_get_affected_rows(&quot;UPDATE test_configurations SET config_is_in_dashboard = false WHERE config_metric = $1&quot;, array($metric_id))) {
-            $succeeded = FALSE;
-            notice(&quot;Failed to remove some configurations from the dashboard.&quot;);
-        }
-
-        else if (array_key_exists('metric_platforms', $_POST)) {
-            foreach ($_POST['metric_platforms'] as $platform_id) {
-                if (!$db-&gt;query_and_get_affected_rows(&quot;UPDATE test_configurations SET config_is_in_dashboard = true
-                    WHERE config_metric = $1 AND config_platform = $2&quot;, array($metric_id, $platform_id))) {
-                    $succeeded = FALSE;
-                    notice(&quot;Failed to add configurations for metric $metric_id and platform $platform_id to the dashboard.&quot;);
-                }
-            }
-        }
-
-        if ($succeeded) {
-            notice(&quot;Updated the dashboard.&quot;);
-            regenerate_manifest();
-        }
-    } else
-        notice('Invalid parameters');
-} else if ($action == 'update') {
</del><ins>+if ($action == 'update') {
</ins><span class="cx">     if (!update_field('tests', 'test', 'url'))
</span><span class="cx">         notice('Invalid parameters');
</span><del>-} else if ($action == 'update-triggerable') {
-    $test_id = intval($_POST['test']);
-    $platform_id = intval($_POST['platform']);
-
-    $triggerable_id = array_get($_POST, 'triggerable');
-    if ($triggerable_id) {
-        $triggerable_id = intval($triggerable_id);
-        $association = array('test' =&gt; $test_id, 'platform' =&gt; $platform_id, 'triggerable' =&gt; $triggerable_id);
-        if (!$db-&gt;insert_row('triggerable_configurations', 'trigconfig', $association, NULL)) {
-            $suceeded = FALSE;
-            notice(&quot;Failed to associate triggerable $triggerable_id with test $test_id on platform $platform_id.&quot;);
-        }
-    } else {
-        $db-&gt;query_and_get_affected_rows('DELETE FROM triggerable_configurations WHERE trigconfig_test = $1 AND trigconfig_platform = $2',
-            array($test_id, $platform_id));
-    }
</del><span class="cx"> } else if ($action == 'add') {
</span><span class="cx">     if (array_key_exists('test_id', $_POST) &amp;&amp; array_key_exists('metric_name', $_POST)) {
</span><span class="cx">         $id = intval($_POST['test_id']);
</span><span class="lines">@@ -74,7 +32,11 @@
</span><span class="cx">         foreach ($aggregators_table as $aggregator_row)
</span><span class="cx">             $aggregators[$aggregator_row['aggregator_id']] = $aggregator_row['aggregator_name'];
</span><span class="cx">     }
</span><del>-    $build_triggerable_table = $db-&gt;fetch_table('build_triggerables', 'triggerable_name') or array();
</del><ins>+    $triggerables = array();
+    if ($triggerable_table = $db-&gt;fetch_table('build_triggerables', 'triggerable_name')) {
+        foreach ($triggerable_table as $triggerable_row)
+            $triggerables[$triggerable_row['triggerable_id']] = $triggerable_row;
+    }
</ins><span class="cx"> 
</span><span class="cx">     $test_name_resolver = new TestNameResolver($db);
</span><span class="cx">     if ($test_name_resolver-&gt;tests()) {
</span><span class="lines">@@ -96,7 +58,7 @@
</span><span class="cx"> &lt;table&gt;
</span><span class="cx"> &lt;thead&gt;
</span><span class="cx">     &lt;tr&gt;&lt;td&gt;Test ID&lt;/td&gt;&lt;td&gt;Full Name&lt;/td&gt;&lt;td&gt;Parent ID&lt;/td&gt;&lt;td&gt;URL&lt;/td&gt;&lt;td&gt;Triggerables&lt;/td&gt;
</span><del>-        &lt;td&gt;Metric ID&lt;/td&gt;&lt;td&gt;Metric Name&lt;/td&gt;&lt;td&gt;Aggregator&lt;/td&gt;&lt;td&gt;Dashboard&lt;/td&gt;
</del><ins>+        &lt;td&gt;Metric ID&lt;/td&gt;&lt;td&gt;Metric Name&lt;/td&gt;&lt;td&gt;Aggregator&lt;/td&gt;
</ins><span class="cx"> &lt;/thead&gt;
</span><span class="cx"> &lt;tbody&gt;
</span><span class="cx"> &lt;?php
</span><span class="lines">@@ -110,45 +72,29 @@
</span><span class="cx">             $row_count = count($test_metrics);
</span><span class="cx">             $child_metrics = $test_name_resolver-&gt;child_metrics_for_test_id($test_id);
</span><span class="cx">             $linked_test_name = htmlspecialchars($test['full_name']);
</span><del>-            if ($child_metrics) {
-                $row_count++;
</del><ins>+            if ($child_metrics)
</ins><span class="cx">                 $linked_test_name = '&lt;a href=&quot;/admin/tests/' . htmlspecialchars($test['full_name']) . '&quot;&gt;' . $linked_test_name . '&lt;/a&gt;';
</span><del>-            }
</del><span class="cx"> 
</span><span class="cx">             $tbody_class = $odd ? 'odd' : 'even';
</span><span class="cx">             $odd = !$odd;
</span><span class="cx"> 
</span><span class="cx">             $test_url = htmlspecialchars($test['test_url']);
</span><span class="cx"> 
</span><del>-            $triggerable_platforms = $db-&gt;query_and_fetch_all('SELECT * FROM platforms
-                LEFT OUTER JOIN triggerable_configurations ON trigconfig_platform = platform_id AND trigconfig_test = $1 ORDER BY platform_name', array($test_id));
-            $triggerables = '';
-            foreach ($triggerable_platforms as $platform_row) {
-                if (!$test_name_resolver-&gt;test_exists_on_platform($test_id, $platform_row['platform_id']))
-                    continue;
</del><ins>+            $triggerable_platform_list = '';
</ins><span class="cx"> 
</span><del>-                $triggerables .= &lt;&lt;&lt; END
-&lt;form method=&quot;POST&quot;&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;test&quot; value=&quot;$test_id&quot;&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;platform&quot; value=&quot;{$platform_row['platform_id']}&quot;&gt;
-    &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;update-triggerable&quot;&gt;
-    &lt;label&gt;
-        {$platform_row['platform_name']}
-        &lt;select name=&quot;triggerable&quot; onchange=&quot;this.form.submit();&quot;&gt;
-            &lt;option value=&quot;&quot;&gt;None&lt;/option&gt;
-END;
-                $selected_triggerable = array_get($platform_row, 'trigconfig_triggerable');
-                foreach ($build_triggerable_table as $triggerable_row) {
-                    $triggerable_id = $triggerable_row['triggerable_id'];
-                    $selected = $triggerable_id == $selected_triggerable ? ' selected' : '';
-                    $triggerables .= &quot;&lt;option value=\&quot;$triggerable_id\&quot;$selected&gt;{$triggerable_row['triggerable_name']}&lt;/option&gt;&quot;;
-                }
-                $triggerables .= &lt;&lt;&lt; END
-        &lt;/select&gt;
-    &lt;/label&gt;
-&lt;/form&gt;
-&lt;br&gt;
-END;
</del><ins>+            $triggerable_platforms = $db-&gt;query_and_fetch_all('SELECT * FROM platforms JOIN triggerable_configurations
+                ON trigconfig_platform = platform_id AND trigconfig_test = $1 ORDER BY trigconfig_triggerable', array($test_id));
+            $previous_triggerable = null;
+            foreach ($triggerable_platforms as $row) {
+                if ($previous_triggerable != $row['trigconfig_triggerable']) {
+                    $previous_triggerable = $row['trigconfig_triggerable'];
+                    if ($triggerable_platform_list)
+                        $triggerable_platform_list .= '&lt;br&gt;';
+                    $name = $triggerables[$previous_triggerable]['triggerable_name'];
+                    $triggerable_platform_list .= &quot;&lt;strong&gt;$name:&lt;/strong&gt; &quot;;
+                } else
+                    $triggerable_platform_list .= ', ';
+                $triggerable_platform_list .= $row['platform_name'];
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             echo &lt;&lt;&lt;EOF
</span><span class="lines">@@ -161,7 +107,7 @@
</span><span class="cx">         &lt;form method=&quot;POST&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;$test_id&quot;&gt;
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;update&quot;&gt;
</span><span class="cx">         &lt;input type=&quot;url&quot; name=&quot;url&quot; value=&quot;$test_url&quot; size=&quot;30&quot;&gt;&lt;/form&gt;&lt;/td&gt;
</span><del>-        &lt;td rowspan=&quot;$row_count&quot;&gt;$triggerables&lt;/td&gt;
</del><ins>+        &lt;td rowspan=&quot;$row_count&quot;&gt;$triggerable_platform_list&lt;/td&gt;
</ins><span class="cx"> EOF;
</span><span class="cx"> 
</span><span class="cx">             if ($test_metrics) {
</span><span class="lines">@@ -186,62 +132,13 @@
</span><span class="cx">         &lt;td&gt;&lt;a href=&quot;/admin/test-configurations?metric=$metric_id&quot;&gt;$metric_id&lt;/a&gt;&lt;/td&gt;
</span><span class="cx">         &lt;td&gt;{$metric['metric_name']}&lt;/td&gt;
</span><span class="cx">         &lt;td&gt;$aggregator_name $aggregator_action&lt;/td&gt;
</span><del>-        &lt;td&gt;&lt;form method=&quot;POST&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;metric_id&quot; value=&quot;$metric_id&quot;&gt;
-EOF;
-
-                    foreach ($platform_names as $platform_name) {
-                        $platform_name = htmlspecialchars($platform_name);
-                        $platform = $name_to_platform[$platform_name];
-                        $configurations = $test_name_resolver-&gt;configurations_for_metric_and_platform($metric_id, $platform['platform_id']);
-                        if (!$configurations)
-                            continue;
-                        echo &quot;&lt;label&gt;&lt;input type=\&quot;checkbox\&quot; name=\&quot;metric_platforms[]\&quot; value=\&quot;{$platform['platform_id']}\&quot;&quot;;
-                        if (Database::is_true($configurations[0]['config_is_in_dashboard']))
-                            echo ' checked';
-                        else if (Database::is_true($platform['platform_hidden']))
-                            echo 'disabled';
-                        echo &quot;&gt;$platform_name&lt;/label&gt;&quot;;
-                    }
-
-                    echo &lt;&lt;&lt;EOF
-        &lt;button type=&quot;submit&quot; name=&quot;action&quot; value=&quot;dashboard&quot;&gt;Save&lt;/button&gt;&lt;/form&gt;
-        &lt;/td&gt;
</del><span class="cx">     &lt;/tr&gt;
</span><span class="cx"> EOF;
</span><span class="cx">                 }
</span><del>-            }
</del><ins>+            } else
+                echo '&lt;td colspan=&quot;3&quot;&gt;&lt;/td&gt;';
</ins><span class="cx"> 
</span><del>-            if ($child_metrics) {
-                echo &lt;&lt;&lt;EOF
-        &lt;td colspan=&quot;5&quot;&gt;&lt;form method=&quot;POST&quot;&gt;
-        &lt;input type=&quot;hidden&quot; name=&quot;test_id&quot; value=&quot;$test_id&quot;&gt;
-        &lt;label&gt;Name&lt;select name=&quot;metric_name&quot;&gt;
-EOF;
-
-                foreach ($child_metrics as $metric) {
-                    $metric_name = htmlspecialchars($metric['metric_name']);
-                    echo &quot;
-            &lt;option&gt;$metric_name&lt;/option&gt;&quot;;
-                }
-
-                echo &lt;&lt;&lt;EOF
-        &lt;/select&gt;&lt;/label&gt;
-        &lt;label&gt;Aggregator
-        &lt;select name=&quot;metric_aggregator&quot;&gt;
-            &lt;option value=&quot;&quot;&gt;-&lt;/option&gt;
-EOF;
-            foreach ($aggregators as $id =&gt; $name) {
-                $name = htmlspecialchars($name);
-                echo &quot;
-            &lt;option value=\&quot;$id\&quot;&gt;$name&lt;/option&gt;&quot;;
-            }
</del><span class="cx">             echo &lt;&lt;&lt;EOF
</span><del>-        &lt;/select&gt;&lt;/label&gt;
-        &lt;button type=&quot;submit&quot; name=&quot;action&quot; value=&quot;add&quot;&gt;Add&lt;/button&gt;&lt;/form&gt;&lt;/td&gt;
-    &lt;/tr&gt;
-EOF;
-            }
-            echo &lt;&lt;&lt;EOF
</del><span class="cx">     &lt;/tbody&gt;
</span><span class="cx"> EOF;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicincludetestnameresolverphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/include/test-name-resolver.php (201999 => 202000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/include/test-name-resolver.php        2016-06-13 19:39:01 UTC (rev 201999)
+++ trunk/Websites/perf.webkit.org/public/include/test-name-resolver.php        2016-06-13 19:40:01 UTC (rev 202000)
</span><span class="lines">@@ -8,7 +8,6 @@
</span><span class="cx">         $this-&gt;test_id_to_child_metrics = array();
</span><span class="cx">         $this-&gt;test_to_metrics = array();
</span><span class="cx">         $this-&gt;tests_sorted_by_full_name = array();
</span><del>-        $this-&gt;metric_to_configurations = array();
</del><span class="cx">         $this-&gt;id_to_metric = array();
</span><span class="cx">         $this-&gt;id_to_aggregator = array();
</span><span class="cx"> 
</span><span class="lines">@@ -28,16 +27,6 @@
</span><span class="cx">         $this-&gt;test_to_metrics = $this-&gt;map_metrics_to_tests($db-&gt;fetch_table('test_metrics'), $test_id_to_parent);
</span><span class="cx">         $this-&gt;tests_sorted_by_full_name = $this-&gt;sort_tests_by_full_name($this-&gt;full_name_to_test);
</span><span class="cx"> 
</span><del>-        if ($configurations = $db-&gt;fetch_table('test_configurations')) {
-            foreach ($configurations as $config) {
-                $metric_id = $config['config_metric'];
-                $platform_id = $config['config_platform'];
-                array_set_default($this-&gt;metric_to_configurations, $metric_id, array());
-                array_set_default($this-&gt;metric_to_configurations[$metric_id], $platform_id, array());
-                array_push($this-&gt;metric_to_configurations[$metric_id][$platform_id], $config);
-            }
-        }
-
</del><span class="cx">         if ($aggregator_table = $db-&gt;fetch_table('aggregators')) {
</span><span class="cx">             foreach ($aggregator_table as $aggregator)
</span><span class="cx">                 $this-&gt;id_to_aggregator[$aggregator['aggregator_id']] = $aggregator;
</span><span class="lines">@@ -126,21 +115,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function configurations_for_metric_and_platform($metric_id, $platform_id) {
</span><del>-        $metric_configurations = array_get($this-&gt;metric_to_configurations, $metric_id, array());
-        return array_get($metric_configurations, $platform_id);
</del><ins>+        return $this-&gt;db-&gt;query_and_fetch_all('SELECT * FROM test_configurations WHERE config_metric = $1 AND config_platform = $2
+            ORDER BY config_id', array($metric_id, $platform_id));
</ins><span class="cx">     }
</span><del>-
-    function test_exists_on_platform($test_id, $platform_id) {
-        foreach ($this-&gt;metrics_for_test_id($test_id) as $metric) {
-            if ($this-&gt;configurations_for_metric_and_platform($metric['metric_id'], $platform_id))
-                return TRUE;
-        }
-        foreach ($this-&gt;child_metrics_for_test_id($test_id) as $metric) {
-            if ($this-&gt;configurations_for_metric_and_platform($metric['metric_id'], $platform_id))
-                return TRUE;
-        }
-        return FALSE;
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>