Skip to content

Commit 9726dc0

Browse files
authored
Merge pull request #6426 from BOINC/dpa_submit35
2 parents d0ab0a3 + fcf0801 commit 9726dc0

3 files changed

Lines changed: 74 additions & 22 deletions

File tree

html/inc/host.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ function show_user_hosts($userid, $private, $show_all, $sort, $rev) {
831831
$now = time();
832832
$old_hosts=0;
833833
$i = 1;
834-
$hosts = BoincHost::enum("userid=$userid order by $sort_clause");
834+
$hosts = BoincHost::enum("userid=$userid order by $sort_clause limit 100");
835835
$any_product_name = false;
836836
foreach ($hosts as $host) {
837837
if ($host->product_name) {

html/user/submit.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -663,20 +663,24 @@ function handle_query_batch($user) {
663663
);
664664
break;
665665
}
666-
echo "<p>";
667-
show_button("submit_stats.php?action=flops_graph&batch_id=$batch_id",
668-
"Job runtimes"
669-
);
670-
show_button("submit.php?action=batch_stats&batch_id=$batch_id",
671-
"Memory/disk usage"
672-
);
673-
echo "<p>";
674-
show_button("submit_stats.php?action=err_host&batch_id=$batch_id",
675-
"Errors by host"
676-
);
677-
show_button("submit_stats.php?action=err_code&batch_id=$batch_id",
678-
"Errors by exit code"
679-
);
666+
echo "<p>
667+
<h3>Completed jobs</h3>
668+
<ul>
669+
<li>
670+
<a href=submit_stats.php?action=flops_graph&batch_id=$batch_id>Job runtimes</a>
671+
<li>
672+
<a href=submit.php?action=batch_stats&batch_id=$batch_id>Memory/disk usage</a>
673+
<li>
674+
<a href=submit_stats.php?action=show_hosts&batch_id=$batch_id>Grouped by host</a>
675+
</ul>
676+
<h3>Failed jobs</h3>
677+
<ul>
678+
<li>
679+
<a href=submit_stats.php?action=err_host&batch_id=$batch_id>Grouped by host</a>
680+
<li>
681+
<a href=submit_stats.php?action=err_code&batch_id=$batch_id>Grouped by exit code</a>
682+
</ul>
683+
";
680684

681685
echo "<h2>Jobs</h2>\n";
682686
start_table();

html/user/submit_stats.php

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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'));
227272
if (!$batch) error_page('no batch');
228273
switch(get_str('action')) {
@@ -232,15 +277,18 @@ function flops_graph($batch) {
232277
case '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;
238283
case 'code_list':
239284
code_list($batch->id, get_int('code'));
240285
break;
241286
case 'flops_graph':
242287
flops_graph($batch);
243288
break;
289+
case 'show_hosts':
290+
show_hosts($batch);
291+
break;
244292
default:
245293
error_page('bad action');
246294
}

0 commit comments

Comments
 (0)