set_cached_data(3600, serialize($gap), "transitioner_backlog"); } show_counts(tra("Transitioner backlog (hours)"), "transitioner_backlog_hours", $gap); if (!$xml) { echo "</table></td><td>"; echo "<table>"; echo "<tr><th>" . tra("Users") . "</th><th>#</th></tr>"; show_counts(tra("with recent credit"), "users_with_recent_credit", get_mysql_count("user where expavg_credit>1")); show_counts(tra("with credit"), "users_with_credit", get_mysql_count("user where total_credit>0")); show_counts(tra("registered in past 24 hours"), "users_registered_in_past_24_hours", get_mysql_count("user where create_time > (unix_timestamp() - (24*3600))")); echo "<tr><th>" . tra("Computers") . "</th><th>#</th></tr>"; show_counts(tra("with recent credit"), "hosts_with_recent_credit", get_mysql_count("host where expavg_credit>1")); show_counts(tra("with credit"), "hosts_with_credit", get_mysql_count("host where total_credit>0")); show_counts(tra("registered in past 24 hours"), "hosts_registered_in_past_24_hours", get_mysql_count("host where create_time > (unix_timestamp() - (24*3600))")); // 200 cobblestones = 1 GigaFLOPS show_counts(tra("current GigaFLOPs"), "current_floating_point_speed", get_mysql_value("SELECT sum(expavg_credit)/200 as value FROM user")); end_table(); echo "</td></tr></table>"; start_table(); echo "<tr><th colspan=5>" . tra("Tasks by application") . "</th></tr>"; row_heading_array(array(tra("application"), tra("unsent"), tra("in progress"), tra("avg runtime of last 100 results in h (min-max)"), tra("users in last 24h"))); $apps = get_mysql_assoc("SELECT * FROM app WHERE deprecated != 1"); foreach ($apps as $app) { $appid = $app["id"]; $uf_name = $app["user_friendly_name"]; echo "<tr><td>{$uf_name}</td>\n <td>" . number_format(get_mysql_count("result where server_state = 2 and appid = {$appid}")) . "</td>\n <td>" . number_format(get_mysql_count("result where server_state = 4 and appid = {$appid}")) . "</td>\n <td>"; $info = get_runtime_info($appid); echo number_format($info->avg, 2) . " (" . number_format($info->min, 2) . " - " . number_format($info->max, 2) . ")"; echo "</td>\n <td>" . number_format(get_mysql_user("and appid = {$appid}")) . "</td>\n </tr>"; } end_table();
if (!$xml) { echo "</table></td><td>"; echo "<table>"; echo "<tr><th>" . tra("Users") . "</th><th>#</th></tr>"; } show_counts(tra("with recent credit"), "users_with_recent_credit", get_mysql_count("user", "expavg_credit>1")); show_counts(tra("with credit"), "users_with_credit", get_mysql_count("user", "total_credit>0")); show_counts(tra("registered in past 24 hours"), "users_registered_in_past_24_hours", get_mysql_count("user", "create_time > (unix_timestamp() - (24*3600))")); if (!$xml) { echo "<tr><th>" . tra("Computers") . "</th><th>#</th></tr>"; } show_counts(tra("with recent credit"), "hosts_with_recent_credit", get_mysql_count("host", "expavg_credit>1")); show_counts(tra("with credit"), "hosts_with_credit", get_mysql_count("host", "total_credit>0")); show_counts(tra("registered in past 24 hours"), "hosts_registered_in_past_24_hours", get_mysql_count("host", "create_time > (unix_timestamp() - (24*3600))")); // 200 cobblestones = 1 GigaFLOPS show_counts(tra("current GigaFLOPs"), "current_floating_point_speed", get_mysql_sum("user", "expavg_credit/200")); if (!$xml) { end_table(); echo "</td></tr></table>"; start_table(); echo "<tr><th colspan=5>" . tra("Tasks by application") . "</th></tr>"; row_heading_array(array(tra("application"), tra("unsent"), tra("in progress"), tra("avg runtime of last 100 results in h (min-max)"), tra("users in last 24h"))); } $apps = get_cached_apps(); if ($xml) { echo " <tasks_by_app>\n"; } foreach ($apps as $app) { $info = get_runtime_info($app->id); if ($xml) { echo " <app>\n";
// $n = `/bin/tail -1 $sendfile`; // show_counts("Results ready to send","results_ready_to_send",$n); show_counts("Results ready to send", "results_ready_to_send", get_mysql_count("result where server_state = 2")); show_counts("Results in progress", "results_in_progress", get_mysql_count("result where server_state = 4")); show_counts("Workunits waiting for validation", "workunits_waiting_for_validation", get_mysql_count("workunit where need_validate=1")); show_counts("Workunits waiting for assimilation", "workunits_waiting_for_assimilation", get_mysql_count("workunit where assimilate_state=1")); show_counts("Workunits waiting for deletion", "workunits_waiting_for_deletion", get_mysql_count("workunit where file_delete_state=1")); show_counts("Results waiting for deletion", "results_waiting_for_deletion", get_mysql_count("result where file_delete_state=1")); $result = mysql_query("select MIN(transition_time) as min from workunit"); $min = mysql_fetch_object($result); mysql_free_result($result); $gap = (time() - $min->min) / 3600; if ($gap < 0 || $min->min == 0) { $gap = 0; } show_counts("Transitioner backlog (hours)", "transitioner_backlog_hours", $gap); if (!$xml) { echo "</table>"; } } $xmlstring = " </database_file_states>\n</server_status>\n"; if ($xml) { echo $xmlstring; } else { if ($xmlout) { fwrite($xmloutfile, $xmlstring); } echo "\r\n\t\t</td>\r\n\t\t<td> </td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t"; page_tail(); } end_cache($cache_period, $cache_args);