//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Failure summary by (app version, error)");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$q = new SqlQueryString();
$q->process_form_items();
$main_query = "\nSELECT\n    app_version_id,\n    app_version.plan_class,\n    case\n        when INSTR(host.os_name, 'Darwin') then 'Darwin'\n        when INSTR(host.os_name, 'Linux') then 'Linux'\n        when INSTR(host.os_name, 'Windows') then 'Windows'\n        when INSTR(host.os_name, 'SunOS') then 'SunOS'\n        when INSTR(host.os_name, 'Solaris') then 'Solaris'\n        when INSTR(host.os_name, 'Mac') then 'Mac'\n        else 'Unknown'\n    end AS OS_Name,\n    exit_status,\n    COUNT(*) AS error_count\nFROM   result\n        left join host on result.hostid = host.id\n        left join app_version on result.app_version_id = app_version.id\nWHERE\n    result.appid = '{$query_appid}' and\n    server_state = '5' and\n    outcome = '3' and\n    received_time > '{$query_received_time}'\nGROUP BY\n    app_version_id,\n    exit_status\norder by error_count desc\n";
$urlquery = $q->urlquery;
$result = mysql_query($main_query);
start_table();
table_header("App version", "Exit Status", "Error Count");
while ($res = mysql_fetch_object($result)) {
    $exit_status_condition = "exit_status={$res->exit_status}";
    $av = BoincAppVersion::lookup_id($res->app_version_id);
    $p = BoincPlatform::lookup_id($av->platformid);
    table_row(sprintf("%.2f", $av->version_num / 100) . " {$p->name} [{$av->plan_class}]", link_results(exit_status_string($res), $urlquery, "{$exit_status_condition}", ""), $res->error_count);
}
mysql_free_result($result);
end_table();
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util_ops.inc";
db_init();
admin_page_head("Failure summary by (app version, error)");
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$q = new SqlQueryString();
$q->process_form_items();
$main_query = "\nSELECT\n    app_version_id,\n    app_version.plan_class,\n    case\n        when INSTR(host.os_name, 'Darwin') then 'Darwin'\n        when INSTR(host.os_name, 'Linux') then 'Linux'\n        when INSTR(host.os_name, 'Windows') then 'Windows'\n        when INSTR(host.os_name, 'SunOS') then 'SunOS'\n        when INSTR(host.os_name, 'Solaris') then 'Solaris'\n        when INSTR(host.os_name, 'Mac') then 'Mac'\n        else 'Unknown'\n    end AS OS_Name,\n    exit_status,\n    COUNT(*) AS error_count\nFROM   result\n        left join host on result.hostid = host.id\n        left join app_version on result.app_version_id = app_version.id\nWHERE\n    result.appid = '{$query_appid}' and\n    server_state = '5' and\n    outcome = '3' and\n    received_time > '{$query_received_time}'\nGROUP BY\n    app_version_id,\n    exit_status\norder by error_count desc\n";
$urlquery = $q->urlquery;
$result = _mysql_query($main_query);
start_table();
table_header("App version", "Exit Status", "Error Count");
while ($res = _mysql_fetch_object($result)) {
    $exit_status_condition = "exit_status={$res->exit_status}";
    table_row(app_version_desc($res->app_version_id), link_results(exit_status_string($res->exit_status), $urlquery, "{$exit_status_condition}", ""), $res->error_count);
}
_mysql_free_result($result);
end_table();
admin_page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
$query_appid = $_GET['appid'];
$query_received_time = time() - $_GET['nsecs'];
$q = new SqlQueryString();
$q->process_form_items();
$main_query = "\r\nSELECT\r\n\tapp_version_num AS App_Version,\r\n\tcase\r\n\t\twhen INSTR(host.os_name, 'Darwin') then 'Darwin'\r\n\t\twhen INSTR(host.os_name, 'Linux') then 'Linux'\r\n\t\twhen INSTR(host.os_name, 'Windows') then 'Windows'\r\n\t\twhen INSTR(host.os_name, 'SunOS') then 'SunOS'\r\n\t\twhen INSTR(host.os_name, 'Solaris') then 'Solaris'\r\n\t\twhen INSTR(host.os_name, 'Mac') then 'Mac'\r\n\t\telse 'Unknown'\r\n\tend AS OS_Name,\r\n\texit_status,\r\n\tCOUNT(*) AS error_count\r\nFROM   result\r\n\t\tleft join host on result.hostid = host.id\r\nWHERE\r\n\tappid = '{$query_appid}' and\r\n\tserver_state = '5' and\r\n\toutcome = '3' and\r\n\treceived_time > '{$query_received_time}'\r\nGROUP BY\r\n\tapp_version_num DESC,\r\n\tOS_Name,\r\n\texit_status\r\n";
$urlquery = $q->urlquery;
$result = mysql_query($main_query);
echo "<table>\n";
echo "<tr><th>App Version</th><th>OS</th><th>Exit Status</th><th>Error Count</th></tr>\n";
while ($res = mysql_fetch_object($result)) {
    echo "<tr>";
    echo "<td align=\"left\" valign=\"top\">";
    echo $res->App_Version;
    echo "</td>";
    echo "<td align=\"left\" valign=\"top\">";
    echo $res->OS_Name;
    echo "</td>";
    echo "<td align=\"left\" valign=\"top\">";
    $exit_status_condition = "exit_status={$res->exit_status}";
    echo link_results(exit_status_string($res), $urlquery, "{$exit_status_condition}", "");
    echo "</td>";
    echo "<td align=\"left\" valign=\"top\">";
    echo $res->error_count;
    echo "</td>";
    echo "</tr>\n";
}
mysql_free_result($result);
echo "</table>\n";
admin_page_tail();
$cvs_version_tracker[] = "\$Id: failure_result_summary_by_platform.php 15758 2008-08-05 22:43:14Z davea \$";
//Generated automatically - do not edit