OILS / regtest / aports / summary.sql View on Github | oils.pub

162 lines, 144 significant
1-- Disagreements
2
3select '<table id="summary-table">';
4
5select
6 printf(
7 '<tr> <td><b>Elapsed Hours</b></td> <td class="num"><b>%.1f</b></td> </tr>',
8 sum(elapsed_minutes) / 60
9 )
10from metrics;
11select
12 printf(
13 '<tr> <td><b>Notable Disagreements</b></td> <td class="num"><b>%d</b></td> </tr>',
14 count(*)
15 )
16from notable_disagree;
17-- Tasks are redundant with APKBUILD files
18-- select printf('<tr>Tasks: %d</tr>', sum(num_tasks)) from metrics;
19select
20 printf(
21 '<tr> <td>Unique causes</td> <td class="num">%d</td> </tr>',
22 count(distinct cause)
23 )
24from notable_disagree
25where cause != 'unknown';
26select
27 printf(
28 '<tr> <td>Packages without a cause assigned (unknown)</td> <td class="num">%s</td> </tr>',
29 count(*)
30 )
31from notable_disagree
32where cause = 'unknown';
33select '</table>';
34
35select '<hr/>';
36
37-- Other
38
39-- select '<ul>';
40-- select printf('<li>Other Failures: %d</li>', count(*)) from other_fail;
41-- select
42-- printf(
43-- '<li>Inconclusive result because of timeout (-124, -143): %d</li>',
44-- count(*)
45-- )
46-- from timeout
47-- where cause like 'signal-%';
48-- select '</ul>';
49
50-- - Side by-side table
51
52create temporary view summary as
53 select
54 sum(
55 case
56 when config = 'baseline' then num_tasks
57 else 0
58 end
59 ) as num_apkbuild,
60 sum(
61 case
62 when config = 'baseline' then num_failures
63 else 0
64 end
65 ) as baseline_failures,
66 sum(
67 case
68 when config = 'osh-as-sh' then num_failures
69 else 0
70 end
71 ) as osh_failures,
72 sum(
73 case
74 when config = 'baseline' then num_timeouts
75 else 0
76 end
77 ) as baseline_timeouts,
78 sum(
79 case
80 when config = 'osh-as-sh' then num_timeouts
81 else 0
82 end
83 ) as osh_timeouts,
84 sum(
85 case
86 when config = 'baseline' then num_apk
87 else 0
88 end
89 ) as baseline_apk,
90 sum(
91 case
92 when config = 'osh-as-sh' then num_apk
93 else 0
94 end
95 ) as osh_apk
96 from metrics;
97
98-- Task failures and packages produced
99
100select '<table id="config-summary-table">';
101select '<thead>';
102select '<tr> <td></td> <td>baseline</td> <td>osh as sh</td> </tr>';
103select '</thead>';
104
105-- both sides work from the same APKBUILD
106select '<tr> <td> <code>APKBUILD</code> files</td>';
107select printf('<td class="num">%d</td>', num_apkbuild) from summary;
108select printf('<td class="num">%d</td>', num_apkbuild) from summary;
109select '</tr>';
110
111select '<tr> <td> <code>.apk</code> built </td>';
112select printf('<td class="num">%d</td>', baseline_apk)
113from summary;
114select printf('<td class="num">%d</td>', osh_apk)
115from summary;
116select '</tr>';
117
118select '<tr> <td>Failures</td>';
119select
120 printf('<td class="num">%d</td>', baseline_failures)
121from summary;
122select
123 printf('<td class="num">%d</td>', osh_failures)
124from summary;
125select '</tr>';
126
127select '<tr> <td></td>';
128select
129 printf(
130 '<td class="num">(%.1f%%)</td>',
131 baseline_failures * 100.0 / num_apkbuild
132 )
133from summary;
134
135select
136 printf('<td class="num">(%.1f%%)</td>', osh_failures * 100.0 / num_apkbuild)
137from summary;
138select '</tr>';
139
140select '<tr> <td>Timeouts</td>';
141select
142 printf('<td class="num">%d</td>', baseline_timeouts)
143from summary;
144select
145 printf('<td class="num">%d</td>', osh_timeouts)
146from summary;
147select '</tr>';
148
149select '<tr> <td></td>';
150select
151 printf(
152 '<td class="num">(%.1f%%)</td>',
153 baseline_timeouts * 100.0 / num_apkbuild
154 )
155from summary;
156
157select
158 printf('<td class="num">(%.1f%%)</td>', osh_timeouts * 100.0 / num_apkbuild)
159from summary;
160select '</tr>';
161
162select '</table>';