1 <?php require("common.php");
5 // queries ::= query | query "###" queries
6 // query ::= name "@@@" sql
8 $limits = array("20","50","100");
10 $quey_all = urlencode("
13 select * from bench order by mark desc***");
15 $query_fail = urlencode("
19 mark, count(distinct test) as fail_no
21 where result = 'fail' group by mark order by mark desc***
25 select distinct mark, test, result
27 where result = 'fail' order by mark desc***");
29 $query_gc = urlencode("
33 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
34 from bench, bench as bench1
36 bench.mark = bench1.mark and
37 bench.test = bench1.test and
38 bench.options = 'gc-on' and
39 bench1.options = 'gc-off' and
40 bench.compilation = bench1.compilation
46 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
47 from bench, bench as bench1
49 bench.mark = bench1.mark and
50 bench.test = bench1.test and
51 bench.options = 'gc-on' and
52 bench1.options = 'gc-off' and
53 bench.compilation = bench1.compilation and
54 bench.compilation = 'opt'
60 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
61 from bench, bench as bench1
63 bench.mark = bench1.mark and
64 bench.test = bench1.test and
65 bench.options = 'gc-on' and
66 bench1.options = 'gc-off' and
67 bench.compilation = bench1.compilation and
68 bench.compilation = 'byte'
71 $query_auto = urlencode("
75 mark, SUM(bench.time) as time
79 test='auto.ma' and options = 'gc-on'
86 mark, SUM(bench.time) as time
90 test='auto.ma' and options = 'gc-off'
98 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
100 bench, bench as bench1
102 bench.mark = bench1.mark and
103 bench.test = bench1.test and
104 bench.options = 'gc-on' and
105 bench1.options = 'gc-off' and
106 bench.compilation = bench1.compilation and
107 bench.test = 'auto.ma'
111 $query_csc = urlencode("
112 Performances (byte and GC) per mark
115 bench_times.mark as mark,
117 bench_times.time as time,
118 bench_times.timeuser as timeuser,
119 bench_times_opt.time as time_opt,
120 bench_times_opt.timeuser as timeuser_opt,
121 bench_times.tests as tests,
122 bench_times_opt.tests as tests_opt,
123 bench_fails.count as fail,
124 bench_fails_opt.count as fail_opt
128 b1.mark as mark, SUM(b1.time) as time,
129 SUM(b1.timeuser) as timeuser,COUNT(DISTINCT b1.test) as tests
132 b1.options = 'gc-on' and
133 b1.compilation = 'opt'
134 group by b1.mark) as bench_times_opt,
136 b1.mark as mark, SUM(b1.time) as time,
137 SUM(b1.timeuser) as timeuser,COUNT(DISTINCT b1.test) as tests
140 b1.options = 'gc-on' and
141 b1.compilation = 'byte'
142 group by b1.mark) as bench_times,
145 SUM(if(b1.result='fail' and b1.compilation='byte' and b1.options='gc-on',1,0))
148 group by b1.mark) as bench_fails,
151 SUM(if(b1.result='fail' and b1.compilation='opt' and b1.options='gc-on',1,0))
154 group by b1.mark) as bench_fails_opt
156 bench_times.mark = bench_fails.mark and
157 bench_times_opt.mark = bench_fails_opt.mark and
158 bench_times.mark = bench_times_opt.mark and
159 bench_svn.mark = bench_times.mark
160 order by bench_svn.mark desc
163 $query_total = urlencode("
167 COUNT(DISTINCT test) as MAX
174 Number of compiled tests
178 COUNT(DISTINCT test) as N
185 function minus1_to_all($s){
192 function links_of($name,$q,$limits){
193 echo "<li>$name : ";
194 if (strpos($q, urlencode("***")) === false) {
195 echo "<a href=\"showquery.php?query=$q;\">all</a>";
197 foreach($limits as $l) {
198 $q1 = str_replace(urlencode("***"), " LIMIT 0,$l", $q);
199 echo "<a href=\"showquery.php?query=$q1;\">" .
200 minus1_to_all($l) . "</a> ";
202 $q1 = str_replace(urlencode("***"), " ", $q);
203 echo "<a href=\"showquery.php?query=$q1;\">" .
204 minus1_to_all("-1") . "</a> ";
213 <link type="text/css" rel="stylesheet" href="style.css"/>
216 <h1>QUERY the benchmark system</h1>
217 <h2>Common Queries</h2>
220 <? links_of("Broken tests",$query_fail,$limits) ?>
221 <? links_of("Garbage collector killer",$query_gc,$limits) ?>
222 <? links_of("Auto performances",$query_auto,$limits) ?>
223 <? links_of("Global performances",$query_csc,$limits) ?>
224 <? links_of("Number of compiled tests",$query_total,$limits) ?>
225 <? links_of("All table contents",$quey_all,$limits) ?>
228 <h2>Custom Query - Simple Interface</h2>
229 <form action="composequery.php" method="get">
234 <select name="mark">";
235 <option value="--">--</option>";
236 <?query("select distinct mark from bench order by mark desc;",
242 <td>Compilations:</td>
244 <select name="compilation">";
245 <option value="--">--</option>";
246 <?query("select distinct compilation from bench;","array_to_combo");?>
253 <select name="options">";
254 <option value="--">--</option>";
255 <?query("select distinct options from bench;","array_to_combo");?>
262 <select name="test">";
263 <option value="--">--</option>";
264 <?query("select distinct test from bench;","array_to_combo");?>
269 <td>Test results:</td>
271 <select name="result">";
272 <option value="--">--</option>";
273 <?query("select distinct result from bench;","array_to_combo"); ?>
280 <select name="groupby">";
281 <option value="--">--</option>";
282 <? array_to_combo(array("mark"));array_to_combo(array("options")); ?>
289 <select name="limit">";
290 <option value="--">--</option>";
291 <? foreach(array($limits) as $l) {array_to_combo($l);} ?>
296 <td><input type="submit" value="Submit" class="button" /></td>
300 <h2>Custom Query - raw SQL</h2>
301 <form action="showquery.php" method="get">
303 <tr><td>'bench' table description:</td></tr>
305 <? query("describe bench","printer"); ?>
309 SQL (only one query, ';' if present must terminate the query, no characters allowed after it):</td></tr>
311 <textarea rows="10" cols="120" name="query"/>
313 b1.test as test, b1.timeuser as oldtime, b2.timeuser as newtime, b1.compilation as comp, b1.options as opts
315 bench as b1, bench as b2
317 b1.test = b2.test and
318 b1.options = b2.options and
319 b1.compilation = b2.compilation and
320 b1.mark = '' and b2.mark= '' and
321 ABS(b1.timeuser - b2.timeuser) > 100;</textarea>
325 <input type="submit" value="Submit" class="button" /></td>