2003-06-11 23:36:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// show summary of results that have been received or timed out recently
|
|
|
|
|
2003-07-17 23:53:32 +00:00
|
|
|
require_once("util_ops.inc");
|
2003-06-11 23:36:44 +00:00
|
|
|
|
|
|
|
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++) {
|
2003-07-01 05:38:42 +00:00
|
|
|
if ($server_state[$ss] == 0) {
|
|
|
|
$x = "0";
|
|
|
|
} else {
|
2003-08-04 23:24:45 +00:00
|
|
|
$x = "<a href=db_action.php?table=result&received_time=$y&result_server_state=$ss&sortby=received_time&detail=low>".$server_state[$ss]."</a>";
|
2003-07-01 05:38:42 +00:00
|
|
|
}
|
|
|
|
row2(result_server_state_string($ss), $x);
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
start_table();
|
|
|
|
echo "<tr><th>Outcome of 'Over' results</th><th># results</th></tr>\n";
|
|
|
|
for ($ro=0; $ro<6; $ro++) {
|
2003-07-01 05:38:42 +00:00
|
|
|
if ($outcome[$ro] == 0) {
|
|
|
|
$x = "0";
|
|
|
|
} else {
|
2003-08-04 23:24:45 +00:00
|
|
|
$x = "<a href=db_action.php?table=result&received_time=$y&result_outcome=$ro&sortby=received_time&detail=low>".$outcome[$ro]."</a>";
|
2003-07-01 05:38:42 +00:00
|
|
|
}
|
|
|
|
row2(result_outcome_string($ro), $x);
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
|
|
|
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++) {
|
2003-07-01 05:38:42 +00:00
|
|
|
if ($client_state[$cs] == 0) {
|
|
|
|
$x = "0";
|
|
|
|
} else {
|
2003-08-04 23:24:45 +00:00
|
|
|
$x = "<a href=db_action.php?table=result&received_time=$y&result_client_state=$cs&sortby=received_time&detail=low>".$client_state[$cs]."</a>";
|
2003-07-01 05:38:42 +00:00
|
|
|
}
|
|
|
|
row2(result_client_state_string($cs), $x);
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
|
|
|
end_table();
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|