[ci skip] multi-user should be multiuser
[scons.git] / timings / index.html
blob79c20393b0b30d1132dea9928fb6c91a1d3e5008
1 <html>
2 <head>
3 <title>SCons Timings</title>
4 <script src="js/common.js"></script>
5 <script language="javascript">
6 var perf_url = DirName(window.location.href);
7 function DisplayGraph(name, heighth, width, thumbnail, graph) {
8 var params = ParseParams();
9 var url = perf_url + '/' + name + '/graph.html' + '?lookout';
10 //var debug = url;
11 var debug = '';
12 if ('history' in params) {
13 url += '&history=' + params.history
15 if (typeof graph == 'undefined') {
16 if ('graph' in params) {
17 graph = params.graph;
19 url += '&header=';
20 } else if (graph != null) {
21 url += '&header=' + graph;
23 if (graph != null) {
24 url += '&graph=' + graph;
26 if (thumbnail) {
27 url += '&thumbnail';
29 document.write('<td>' + debug + '<iframe' +
30 //' scrolling="no"' +
31 ' height="' + heighth + '"' +
32 ' width="' + width + '"' +
33 ' src="' + url + '">' +
34 '</iframe></td>');
36 </script>
37 </head>
38 <body>
39 <center>
40 <script language="javascript">
41 var params = ParseParams();
42 // TODO: parameterize these in a .dat file
43 var builder_map = {
44 'Ubuntu': 'ubuntu-timings',
46 var graphs_map = {
47 'Performance': 'TimeSCons-elapsed',
48 'Memory': 'memory-final',
50 var test_map = {
51 'CPPPATH': 'CPPPATH',
52 'ElectricCloud': 'ElectricCloud',
53 'Java': 'Java',
54 'JTimer': 'JTimer',
55 'hundred': 'hundred',
57 if ('builder' in params) {
58 builder_list = params.builder.split(',');
59 } else {
60 builder_list = Keys(builder_map);
62 if ('graph' in params) {
63 graphs_list = param.graph.split(',');
64 } else {
65 graphs_list = Keys(graphs_map);
67 if ('test' in params) {
68 test_list = params.test.split(',');
69 } else {
70 test_list = Keys(test_map);
72 function write_builder_table() {
73 document.write('<table><tr>');
74 for (var tindex=0; tindex < test_list.length; tindex++) {
75 test = test_list[tindex];
76 test_name = test_map[test];
77 DisplayGraph(builder_id + '/' + test, 250, 400, false);
78 DisplayGraph(builder_id + '/' + test, 250, 400, false);
79 if ((tindex % 3) == 2) {
80 document.write('</tr><tr>');
83 document.write('</tr></table>');
85 function write_test_table() {
86 document.write('<table>');
87 row = [];
88 function write_row(row) {
89 document.write('<tr>');
90 for (var bidx in row) {
91 builder = row[bidx];
92 document.write('<th align="center"><p><br>' +
93 builder + '</p></th>');
95 document.write('</tr><tr>');
96 for (var bidx in row) {
97 builder_id = builder_map[row[bidx]];
98 DisplayGraph(builder_id + '/' + test, 250, 400, true);
100 document.write('</tr>');
102 for (var bindex=0; bindex < builder_list.length; bindex++) {
103 builder = builder_list[bindex];
104 row.push(builder)
105 if ((bindex % 3) == 2) {
106 write_row(row);
107 row = [];
110 if (row.length > 0) {
111 write_row(row);
113 document.write('</table>');
115 function write_builders_header_row() {
116 document.write('<tr><th>&nbsp;</th>');
117 for (var bindex=0; bindex < builder_list.length; bindex++) {
118 builder = builder_list[bindex];
119 url = MakeURL({'builder':escape(builder)});
120 var s ='<th align="center" colspan="' +
121 graphs_list.length +
122 '">' +
123 '<a href="' + url + '">' +
124 builder +
125 '</a></th>';
126 document.write(s);
128 document.write('</tr>');
130 function write_graphs_header_row() {
131 document.write('<tr><th>&nbsp;</th>');
132 for (var bindex=0; bindex < builder_list.length; bindex++) {
133 for (var gindex=0; gindex < graphs_list.length; gindex++) {
134 graph = graphs_list[gindex];
135 document.write('<th align="center">' + graph + '</th>');
139 function write_overview_table() {
140 document.write('<table>');
141 var width = document.body.scrollWidth / (builder_list.length + 2);
142 write_builders_header_row();
143 for (var tindex=0; tindex < test_list.length; tindex++) {
144 // Write a graphs header every four rows for navigability.
145 // TODO: Use more sophisticated freezing of the header rows?
146 if ((tindex % 4) == 0) {
147 write_graphs_header_row();
149 test = test_list[tindex];
150 test_name = test_map[test];
151 document.write('<tr>');
152 url = MakeURL({'test':escape(test)});
153 document.write('<th valign="center"><a href="' + url + '">'
154 + test_name + '</a></th>');
155 for (var bindex=0; bindex < builder_list.length; bindex++) {
156 builder = builder_list[bindex];
157 builder_id = builder_map[builder];
158 DisplayGraph(builder_id + '/' + test, 250, width, true, "TimeSCons-elapsed")
159 DisplayGraph(builder_id + '/' + test, 250, width, true, "memory-final")
161 document.write('<th valign="center"><a href="' + url + '">'
162 + test_name + '</a></th>');
163 document.write('</tr>');
165 write_graphs_header_row();
166 write_builders_header_row();
167 document.write('</table>');
169 function write_header(header_string, url_string) {
170 document.write('<h1><a href="' + window.location.pathname + '">'
171 + 'SCons Timings</a>');
172 if (header_string) {
173 document.write(': ' + header_string);
175 if ('graph' in params) {
176 document.write(': ' + escape(params.graph))
177 } else {
178 document.write(': overview');
180 document.write('</h1>');
182 if (builder_list.length == 0) {
183 builder = builder_list[0];
184 builder_id = builder_map[builder];
185 write_header(builder, '&builder=' + escape(builder));
186 write_builder_table()
187 } else if (test_list.length == 1) {
188 test = test_list[0];
189 test_name = test_map[test];
190 write_header(test_name, '&test=' + escape(test));
191 write_test_table()
192 } else {
193 write_header('', '');
194 write_overview_table();
196 </script>
197 </center>
198 </body>
199 </html>