2003-08-04 23:37:32 +00:00
|
|
|
<?php {
|
2003-06-11 23:36:44 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
2003-08-04 23:57:37 +00:00
|
|
|
function link_results($n, $query) {
|
|
|
|
if ($n == 0) {
|
|
|
|
return "0";
|
|
|
|
} else {
|
2003-08-05 00:11:41 +00:00
|
|
|
return "<a href=db_action.php?table=result&$query&detail=low>$n</a>";
|
|
|
|
// &sort_by=received_time
|
2003-08-04 23:57:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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.;
|
2003-08-04 23:57:37 +00:00
|
|
|
echo "Results that have finished in last $x hours: $x\n";
|
2003-06-11 23:36:44 +00:00
|
|
|
$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);
|
|
|
|
|
2003-08-05 00:11:41 +00:00
|
|
|
echo "<table width=100%>";
|
|
|
|
echo "<tr valign=top>";
|
|
|
|
echo "<td><h3>All results</h3></td>";
|
|
|
|
echo "<td><h3>'Over' results</h3></td>";
|
|
|
|
echo "<td><h3>'Client error' results</h3></td>";
|
|
|
|
echo "</tr>";
|
|
|
|
echo "<tr valign=top>";
|
2003-08-04 23:57:37 +00:00
|
|
|
echo "<td><table border=2 cellpadding=4\n";
|
2003-06-11 23:36:44 +00:00
|
|
|
echo "<tr><th>Server state</th><th># results</th></tr>\n";
|
|
|
|
for ($ss=1; $ss<6; $ss++) {
|
2003-08-04 23:57:37 +00:00
|
|
|
row2(result_server_state_string($ss),
|
|
|
|
link_results($server_state[$ss], "result_server_state=$ss"));
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
2003-08-04 23:57:37 +00:00
|
|
|
echo "</table></td>";
|
|
|
|
|
|
|
|
echo "<td><table border=2 cellpadding=4\n";
|
|
|
|
echo "<tr><th>Outcome</th><th># results</th></tr>\n";
|
2003-06-11 23:36:44 +00:00
|
|
|
for ($ro=0; $ro<6; $ro++) {
|
2003-08-04 23:57:37 +00:00
|
|
|
c_row2(outcome_color($ro), result_outcome_string($ro),
|
|
|
|
link_results($outcome[$ro], "result_outcome=$ro"));
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
2003-08-04 23:57:37 +00:00
|
|
|
echo "</table></td>";
|
|
|
|
|
|
|
|
echo "<td><table border=2 cellpadding=4\n";
|
|
|
|
echo "<tr><th>Client state</th><th># results</th></tr>\n";
|
2003-06-11 23:36:44 +00:00
|
|
|
for ($cs=1; $cs<6; $cs++) {
|
2003-08-04 23:57:37 +00:00
|
|
|
row2(result_client_state_string($cs),
|
|
|
|
link_results($client_state[$cs], "result_client_state=$cs"));
|
2003-06-11 23:36:44 +00:00
|
|
|
}
|
2003-08-04 23:57:37 +00:00
|
|
|
print "</td></table>";
|
|
|
|
print "</table>";
|
2003-06-11 23:36:44 +00:00
|
|
|
|
|
|
|
page_tail();
|
2003-08-04 23:37:57 +00:00
|
|
|
} ?>
|