@@ -49,14 +49,15 @@ function err_host($batch) {
4949 text_start ();
5050 arsort ($ x );
5151 start_table ();
52- table_header ('Host ' , '# errors ' );
52+ table_header ('Host ' , 'OS ' , ' # errors ' );
5353 $ n = 0 ;
5454 foreach ($ x as $ id =>$ count ) {
5555 $ host = BoincHost::lookup_id ($ id );
5656 table_row (
5757 "<a href=show_host_detail.php?hostid= $ id> $ host ->domain_name </a> " ,
58+ $ host ->os_name ,
5859 sprintf (
59- '<a href=submit_stats.php?action=host_list &host_id=%d&batch_id=%d>%d</a> ' ,
60+ '<a href=submit_stats.php?action=host_list_errors &host_id=%d&batch_id=%d>%d</a> ' ,
6061 $ id , $ batch ->id , $ count
6162 )
6263 );
@@ -108,7 +109,7 @@ function err_code($batch) {
108109
109110// list of error results from a host
110111//
111- function host_list ($ batch_id , $ host_id ) {
112+ function host_list_errors ($ batch_id , $ host_id ) {
112113 page_head ("Errors for batch $ batch_id, host $ host_id " );
113114 $ results = BoincResult::enum (
114115 sprintf ('batch=%d and hostid=%d and outcome=%d ' ,
@@ -138,14 +139,22 @@ function code_list($batch_id, $code) {
138139 )
139140 );
140141
142+ text_start ();
141143 start_table ();
142- table_header ('Job instance ' );
144+ table_header ('Job instance ' , ' Host ' );
143145 foreach ($ results as $ r ) {
146+ $ host = BoincHost::lookup_id ($ r ->hostid );
144147 table_row (
145- "<a href=result.php?resultid= $ r ->id > $ r ->name </a> "
148+ "<a href=result.php?resultid= $ r ->id > $ r ->name </a> " ,
149+ sprintf ('<a href=show_host_detail.php?hostid=%d>%d (%s)</a> ' ,
150+ $ host ->id ,
151+ $ host ->id ,
152+ $ host ->os_name
153+ )
146154 );
147155 }
148156 end_table ();
157+ text_end ();
149158 page_tail ();
150159}
151160
@@ -223,6 +232,42 @@ function flops_graph($batch) {
223232 page_tail ();
224233}
225234
235+ // show hosts that did jobs for this batch
236+ function show_hosts ($ batch ) {
237+ $ results = BoincResult::enum_fields (
238+ 'hostid ' ,
239+ sprintf ('batch=%d and outcome=%d ' ,
240+ $ batch ->id ,
241+ RESULT_OUTCOME_SUCCESS
242+ )
243+ );
244+ $ x = [];
245+ foreach ($ results as $ r ) {
246+ $ id = $ r ->hostid ;
247+ if (array_key_exists ($ id , $ x )) {
248+ $ x [$ id ] += 1 ;
249+ } else {
250+ $ x [$ id ] = 1 ;
251+ }
252+ }
253+ arsort ($ x );
254+ page_head ("Batch $ batch ->id : completed jobs grouped by host " );
255+ text_start ();
256+ start_table ();
257+ table_header ('Host ' , 'OS ' , '# jobs ' );
258+ foreach ($ x as $ id => $ count ) {
259+ $ host = BoincHost::lookup_id ($ id );
260+ table_row (
261+ "<a href=show_host_detail.php?hostid= $ id> $ id</a> " ,
262+ $ host ->os_name ,
263+ $ count
264+ );
265+ }
266+ end_table ();
267+ text_end ();
268+ page_tail ();
269+ }
270+
226271$ batch = BoincBatch::lookup_id (get_int ('batch_id ' ));
227272if (!$ batch ) error_page ('no batch ' );
228273switch (get_str ('action ' )) {
@@ -232,15 +277,18 @@ function flops_graph($batch) {
232277case 'err_code ' :
233278 err_code ($ batch );
234279 break ;
235- case 'host_list ' :
236- host_list ($ batch ->id , get_int ('host_id ' ));
280+ case 'host_list_errors ' :
281+ host_list_errors ($ batch ->id , get_int ('host_id ' ));
237282 break ;
238283case 'code_list ' :
239284 code_list ($ batch ->id , get_int ('code ' ));
240285 break ;
241286case 'flops_graph ' :
242287 flops_graph ($ batch );
243288 break ;
289+ case 'show_hosts ' :
290+ show_hosts ($ batch );
291+ break ;
244292default :
245293 error_page ('bad action ' );
246294}
0 commit comments