result summary on admin web

svn path=/trunk/boinc/; revision=1401
This commit is contained in:
David Anderson 2003-06-11 23:36:44 +00:00
parent 1d7490a9be
commit cdc4e3c22e
4 changed files with 65 additions and 21 deletions

View File

@ -1,16 +0,0 @@
<title>BOINC Project Management</title>
<h2>BOINC Project Management</h2>
<p>
Browse database:
<ul>
<li><a href=db.php?show=platform>Platforms</a>
<li><a href=db.php?show=app>Applications</a>
<li><a href=db.php?show=app_version>Application versions</a>
<li><a href=db.php?show=user>Users</a>
<li><a href=db.php?show=team>Teams</a>
<li><a href=db.php?show=host>Hosts</a>
<li><a href=db.php?show=workunit>Workunits</a>
<li><a href=db.php?show=result>Results</a>
</ul>
<a href=stripchart.cgi>Stripcharts</a>

View File

@ -19,6 +19,8 @@ Browse database:
<li><a href=db.php?show=workunit>Workunits</a>
<li><a href=db.php?show=result>Results</a>
</ul>
<a href=result_summary.php?nsecs=86400>Result summary, last 24 hours</a>
<br>
<a href=$cgi_url/stripchart.cgi>Stripcharts</a>
EOT;

View File

@ -0,0 +1,63 @@
<?php
// show summary of results that have been received or timed out recently
require_once("util.inc");
db_init();
page_head("Result summary");
$server_state = array();
$outcome = array();
$client_state = array();
$nsecs = $_GET["nsecs"];
for ($ss=1; $ss<6; $ss++) {
$server_state[$ss] = 0;
}
for ($ro=0; $ro<6; $ro++) {
$outcome[$ro] = 0;
}
for ($cs=1; $cs<6; $cs++) {
$client_state[$cs] = 0;
}
$x = $nsecs/3600.;
echo "Results that have finished in last $x hours\n";
$y = time() - $nsecs;
$result = mysql_query("select * from result where received_time > $y");
while ($res = mysql_fetch_object($result)) {
$server_state[$res->server_state] += 1;
if ($res->server_state == 5) {
$outcome[$res->outcome] += 1;
if ($res->outcome == 3) {
$client_state[$res->client_state] += 1;
}
}
}
mysql_free_result($result);
start_table();
echo "<tr><th>Server state</th><th># results</th></tr>\n";
for ($ss=1; $ss<6; $ss++) {
row2(result_server_state_string($ss), $server_state[$ss]);;
}
end_table();
start_table();
echo "<tr><th>Outcome of 'Over' results</th><th># results</th></tr>\n";
for ($ro=0; $ro<6; $ro++) {
row2(result_outcome_string($ro), $outcome[$ro]);
}
end_table();
start_table();
echo "<tr><th>Client state of 'Client error' results</th><th># results</th></tr>\n";
for ($cs=1; $cs<6; $cs++) {
row2(result_client_state_string($cs), $client_state[$cs]);
}
end_table();
page_tail();
?>

View File

@ -403,8 +403,6 @@ int update_host_record(SCHEDULER_REQUEST& sreq, HOST& xhost) {
compute_credit_rating(host);
safe_strcpy(host.projects, sreq.projects_xml);
retval = host.update();
if (retval) {
sprintf(buf, "host.update() failed: %d\n", retval);
@ -493,9 +491,6 @@ int handle_results(
if (result.server_state == RESULT_SERVER_STATE_OVER) {
result.file_delete_state = FILE_DELETE_READY;
}
if (result.server_state == RESULT_SERVER_STATE_IN_PROGRESS) {
result.server_state = RESULT_SERVER_STATE_OVER;
}
if (result.hostid != sreq.hostid) {
sprintf(buf,