PageRenderTime 86ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/src/boinc-7.0.36/html/ops/failure_result_summary_by_host.php

https://github.com/matszpk/native-boinc-for-android
PHP | 89 lines | 63 code | 10 blank | 16 comment | 4 complexity | 3c21bde0e70ee891eff9cd33532a8435 MD5 | raw file
  1. <?php
  2. // This file is part of BOINC.
  3. // http://boinc.berkeley.edu
  4. // Copyright (C) 2008 University of California
  5. //
  6. // BOINC is free software; you can redistribute it and/or modify it
  7. // under the terms of the GNU Lesser General Public License
  8. // as published by the Free Software Foundation,
  9. // either version 3 of the License, or (at your option) any later version.
  10. //
  11. // BOINC is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. // See the GNU Lesser General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Lesser General Public License
  17. // along with BOINC. If not, see <http://www.gnu.org/licenses/>.
  18. require_once("../inc/util_ops.inc");
  19. db_init();
  20. admin_page_head("Failures grouped by app version and host");
  21. $query_appid = $_GET['appid'];
  22. $query_received_time = time() - $_GET['nsecs'];
  23. $main_query = "
  24. SELECT
  25. app_version_id,
  26. app_version_num,
  27. hostid AS Host_ID,
  28. case
  29. when INSTR(host.os_name, 'Darwin') then 'Darwin'
  30. when INSTR(host.os_name, 'Linux') then 'Linux'
  31. when INSTR(host.os_name, 'Windows') then 'Windows'
  32. when INSTR(host.os_name, 'SunOS') then 'SunOS'
  33. when INSTR(host.os_name, 'Solaris') then 'Solaris'
  34. when INSTR(host.os_name, 'Mac') then 'Mac'
  35. else 'Unknown'
  36. end AS OS_Name,
  37. case
  38. when INSTR(host.os_name, 'Linux') then
  39. case
  40. when INSTR(LEFT(host.os_version, 6), '-') then LEFT(host.os_version, (INSTR(LEFT(host.os_version, 6), '-') - 1))
  41. else LEFT(host.os_version, 6)
  42. end
  43. else host.os_version
  44. end AS OS_Version,
  45. host.nresults_today AS Results_Today,
  46. COUNT(*) AS error_count
  47. FROM result
  48. left join host on result.hostid = host.id
  49. WHERE
  50. appid = '$query_appid' and
  51. server_state = '5' and
  52. outcome = '3' and
  53. received_time > '$query_received_time'
  54. GROUP BY
  55. app_version_id,
  56. hostid
  57. order by error_count desc
  58. ";
  59. $result = mysql_query($main_query);
  60. start_table();
  61. table_header(
  62. "App version", "Host ID", "OS Version", "Results today",
  63. "Error count"
  64. );
  65. while ($res = mysql_fetch_object($result)) {
  66. $av = BoincAppVersion::lookup_id($res->app_version_id);
  67. $p = BoincPlatform::lookup_id($av->platformid);
  68. table_row(
  69. sprintf("%.2f", $res->app_version_num/100)." $p->name [$av->plan_class]",
  70. $res->Host_ID,
  71. $res->OS_Version, $res->Results_Today,
  72. "<a href=db_action.php?table=result&detail=low&hostid=$res->Host_ID&app_version_id=$res->app_version_id&server_state=5&outcome=3>$res->error_count</a>"
  73. );
  74. }
  75. mysql_free_result($result);
  76. end_table();
  77. admin_page_tail();
  78. $cvs_version_tracker[]="\$Id: failure_result_summary_by_host.php 25171 2012-01-31 07:21:42Z davea $"; //Generated automatically - do not edit
  79. ?>