1 <?php require("common.php");
5 // queries ::= query | query "###" queries
6 // query ::= name "@@@" sql
8 $limits = array("20","50","100");
10 $query_last_mark = "select mark from bench order by mark desc limit 1;";
12 function set_last_mark($a) {
14 foreach ($a as $k => $v) {
18 query($query_last_mark,"set_last_mark");
20 $query_before_last_mark = "select mark from bench where mark <> '$last_mark' order by mark desc limit 1;";
21 $before_last_mark = "";
22 function set_before_last_mark($a) {
23 global $before_last_mark;
24 foreach ($a as $k => $v) {
25 $before_last_mark = $v;
28 query($query_before_last_mark,"set_before_last_mark");
30 $quey_all = urlencode("
33 select * from bench order by mark desc***");
35 $query_diff = urlencode("
39 b1.test as test, b1.timeuser as oldtime, b2.timeuser as newtime, b1.compilation as comp, b1.options as opts,
40 (b2.timeuser - b1.timeuser) as diff
42 bench as b1, bench as b2
45 b1.options = b2.options and
46 b1.compilation = b2.compilation and
47 b1.result = b2.result and
48 b1.mark = '$before_last_mark' and b2.mark= '$last_mark' and
49 ABS(b2.timeuser - b1.timeuser) > 100
50 order by diff desc***");
52 $query_fail = urlencode("
56 mark, count(distinct test) as fail_no
58 where result = 'fail' group by mark order by mark desc***
62 select distinct mark, test, result
64 where result = 'fail' order by mark desc***");
66 $query_gc = urlencode("
70 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
71 from bench, bench as bench1
73 bench.mark = bench1.mark and
74 bench.test = bench1.test and
75 bench.options = 'gc-on' and
76 bench1.options = 'gc-off' and
77 bench.compilation = bench1.compilation
83 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
84 from bench, bench as bench1
86 bench.mark = bench1.mark and
87 bench.test = bench1.test and
88 bench.options = 'gc-on' and
89 bench1.options = 'gc-off' and
90 bench.compilation = bench1.compilation and
91 bench.compilation = 'opt'
97 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
98 from bench, bench as bench1
100 bench.mark = bench1.mark and
101 bench.test = bench1.test and
102 bench.options = 'gc-on' and
103 bench1.options = 'gc-off' and
104 bench.compilation = bench1.compilation and
105 bench.compilation = 'byte'
108 $query_auto = urlencode("
112 mark, SUM(bench.time) as time
116 test='auto.ma' and options = 'gc-on'
118 order by mark desc***
123 mark, SUM(bench.time) as time
127 test='auto.ma' and options = 'gc-off'
135 bench.mark, SUM(bench.time) - SUM(bench1.time) as gc_hoverhead
137 bench, bench as bench1
139 bench.mark = bench1.mark and
140 bench.test = bench1.test and
141 bench.options = 'gc-on' and
142 bench1.options = 'gc-off' and
143 bench.compilation = bench1.compilation and
144 bench.test = 'auto.ma'
148 $query_csc = urlencode("
149 Performances (byte and GC) per mark
152 bench_times.mark as mark,
154 bench_times.time as time,
155 bench_times.timeuser as timeuser,
156 bench_times_opt.time as time_opt,
157 bench_times_opt.timeuser as timeuser_opt,
158 bench_times.tests as tests,
159 bench_times_opt.tests as tests_opt,
160 bench_fails.count as fail,
161 bench_fails_opt.count as fail_opt
165 b1.mark as mark, SUM(b1.time) as time,
166 SUM(b1.timeuser) as timeuser,COUNT(DISTINCT b1.test) as tests
169 b1.options = 'gc-on' and
170 b1.compilation = 'opt'
171 group by b1.mark) as bench_times_opt,
173 b1.mark as mark, SUM(b1.time) as time,
174 SUM(b1.timeuser) as timeuser,COUNT(DISTINCT b1.test) as tests
177 b1.options = 'gc-on' and
178 b1.compilation = 'byte'
179 group by b1.mark) as bench_times,
182 SUM(if(b1.result='fail' and b1.compilation='byte' and b1.options='gc-on',1,0))
185 group by b1.mark) as bench_fails,
188 SUM(if(b1.result='fail' and b1.compilation='opt' and b1.options='gc-on',1,0))
191 group by b1.mark) as bench_fails_opt
193 bench_times.mark = bench_fails.mark and
194 bench_times_opt.mark = bench_fails_opt.mark and
195 bench_times.mark = bench_times_opt.mark and
196 bench_svn.mark = bench_times.mark
197 order by bench_svn.mark desc
200 $query_total = urlencode("
204 COUNT(DISTINCT test) as MAX
211 Number of compiled tests
215 COUNT(DISTINCT test) as N
222 function minus1_to_all($s){
229 function links_of($name,$q,$limits){
230 echo "<li>$name : ";
231 if (strpos($q, urlencode("***")) === false) {
232 echo "<a href=\"showquery.php?query=$q;\">all</a>";
234 foreach($limits as $l) {
235 $q1 = str_replace(urlencode("***"), " LIMIT 0,$l", $q);
236 echo "<a href=\"showquery.php?query=$q1;\">" .
237 minus1_to_all($l) . "</a> ";
239 $q1 = str_replace(urlencode("***"), " ", $q);
240 echo "<a href=\"showquery.php?query=$q1;\">" .
241 minus1_to_all("-1") . "</a> ";
250 <link type="text/css" rel="stylesheet" href="style.css"/>
253 <h1>QUERY the benchmark system</h1>
254 <h2>Common Queries</h2>
257 <? links_of("Broken tests",$query_fail,$limits) ?>
258 <? links_of("Time diff",$query_diff,$limits) ?>
259 <? links_of("Garbage collector killer",$query_gc,$limits) ?>
260 <? links_of("Auto performances",$query_auto,$limits) ?>
261 <? links_of("Global performances",$query_csc,$limits) ?>
262 <? links_of("Number of compiled tests",$query_total,$limits) ?>
263 <? links_of("All table contents",$quey_all,$limits) ?>
266 <h2>Custom Query - Simple Interface</h2>
267 <form action="composequery.php" method="get">
272 <select name="mark">";
273 <option value="--">--</option>";
274 <?query("select distinct mark from bench order by mark desc;",
280 <td>Compilations:</td>
282 <select name="compilation">";
283 <option value="--">--</option>";
284 <?query("select distinct compilation from bench;","array_to_combo");?>
291 <select name="options">";
292 <option value="--">--</option>";
293 <?query("select distinct options from bench;","array_to_combo");?>
300 <select name="test">";
301 <option value="--">--</option>";
302 <?query("select distinct test from bench order by test;","array_to_combo");?>
307 <td>Test results:</td>
309 <select name="result">";
310 <option value="--">--</option>";
311 <?query("select distinct result from bench;","array_to_combo"); ?>
318 <select name="groupby">";
319 <option value="--">--</option>";
320 <? array_to_combo(array("mark"));array_to_combo(array("options")); ?>
327 <select name="limit">";
328 <option value="--">--</option>";
329 <? foreach(array($limits) as $l) {array_to_combo($l);} ?>
334 <td><input type="submit" value="Submit" class="button" /></td>
338 <h2>Custom Query - raw SQL</h2>
339 <form action="showquery.php" method="get">
341 <tr><td>'bench' table description:</td></tr>
343 <? query("describe bench","printer"); ?>
347 SQL (only one query, ';' if present must terminate the query, no characters allowed after it):</td></tr>
349 <textarea rows="10" cols="120" name="query"/>
351 b1.test as test, b1.timeuser as oldtime, b2.timeuser as newtime, b1.compilation as comp, b1.options as opts,
352 (b2.timeuser - b1.timeuser) as diff
354 bench as b1, bench as b2
356 b1.test = b2.test and
357 b1.options = b2.options and
358 b1.compilation = b2.compilation and
359 b1.result = b2.result and
360 b1.mark = '<?php echo $before_last_mark ?>' and b2.mark= '<?php echo $last_mark ?>' and
361 ABS(b2.timeuser - b1.timeuser) < 100
367 <input type="submit" value="Submit" class="button" /></td>