|
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
|
|
|
|
|
19
|
|
|
// Show how many unsent results are committed to each HR class |
|
20
|
|
|
|
|
21
|
|
|
// TODO: convert to use new DB interface |
|
|
|
|
|
|
22
|
|
|
// TODO: document in the wiki |
|
|
|
|
|
|
23
|
|
|
|
|
24
|
|
|
include_once( "../inc/db.inc" ); |
|
25
|
|
|
include_once( "../inc/util.inc" ); |
|
26
|
|
|
include_once( "../inc/db_ops.inc" ); |
|
27
|
|
|
include_once( "../inc/util_ops.inc" ); |
|
28
|
|
|
include_once( "../inc/prefs.inc" ); |
|
29
|
|
|
|
|
30
|
|
|
$system_string[ 128 ] = "No OS"; |
|
|
|
|
|
|
31
|
|
|
$system_string[ 256 ] = "Linux"; |
|
|
|
|
|
|
32
|
|
|
$system_string[ 384 ] = "Windows"; |
|
|
|
|
|
|
33
|
|
|
$system_string[ 512 ] = "Darwin"; |
|
|
|
|
|
|
34
|
|
|
$system_string[ 640 ] = "FreeBSD"; |
|
|
|
|
|
|
35
|
|
|
|
|
36
|
|
|
$cpu_string[ 0 ] = "Unspecified"; |
|
|
|
|
|
|
37
|
|
|
$cpu_string[ 1 ] = "No cpu"; |
|
|
|
|
|
|
38
|
|
|
$cpu_string[ 2 ] = "Intel"; |
|
|
|
|
|
|
39
|
|
|
$cpu_string[ 3 ] = "AMD"; |
|
|
|
|
|
|
40
|
|
|
$cpu_string[ 4 ] = "Macintosh"; |
|
|
|
|
|
|
41
|
|
|
$cpu_string[ 5 ] = "AMD Athlon"; |
|
|
|
|
|
|
42
|
|
|
$cpu_string[ 6 ] = "AMD Duron"; |
|
|
|
|
|
|
43
|
|
|
$cpu_string[ 7 ] = "AMD Sempron"; |
|
|
|
|
|
|
44
|
|
|
$cpu_string[ 8 ] = "AMD Opteron"; |
|
|
|
|
|
|
45
|
|
|
$cpu_string[ 9 ] = "AMD Athlon 64"; |
|
|
|
|
|
|
46
|
|
|
$cpu_string[ 10 ] = "AMD Athlon XP"; |
|
|
|
|
|
|
47
|
|
|
$cpu_string[ 11 ] = "Intel Xeon"; |
|
|
|
|
|
|
48
|
|
|
$cpu_string[ 12 ] = "Intel Celeron"; |
|
|
|
|
|
|
49
|
|
|
$cpu_string[ 13 ] = "Intel Pentium"; |
|
|
|
|
|
|
50
|
|
|
$cpu_string[ 14 ] = "Intel Pentium II"; |
|
|
|
|
|
|
51
|
|
|
$cpu_string[ 15 ] = "Intel Pentium III"; |
|
|
|
|
|
|
52
|
|
|
$cpu_string[ 16 ] = "Intel Pentium 4"; |
|
|
|
|
|
|
53
|
|
|
$cpu_string[ 17 ] = "Intel Pentium D"; |
|
|
|
|
|
|
54
|
|
|
$cpu_string[ 18 ] = "Intel Pentium M"; |
|
|
|
|
|
|
55
|
|
|
$cpu_string[ 19 ] = "AMD Athlon MP"; |
|
|
|
|
|
|
56
|
|
|
$cpu_string[ 20 ] = "AMD Turion"; |
|
|
|
|
|
|
57
|
|
|
$cpu_string[ 21 ] = "Intel Core2"; |
|
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
$query = "SELECT COUNT(workunit.id) AS count FROM workunit LEFT JOIN result ON workunit.id=result.workunitid WHERE result.server_state=2 AND workunit.hr_class="; |
|
60
|
|
|
|
|
61
|
|
|
function get_mysql_count($hr_class) { |
|
62
|
|
|
$result = _mysql_query("select count(id) as count from workunit where hr_class=" . $hr_class); |
|
63
|
|
|
$count = _mysql_fetch_object($result); |
|
64
|
|
|
_mysql_free_result($result); |
|
65
|
|
|
return $count->count; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
function make_reset_url($hr_class) { |
|
69
|
|
|
return ("<a href=ops_reset_hrclass.php?hr_class=".$hr_class.">".$hr_class."</a>"); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
db_init(); |
|
73
|
|
|
|
|
74
|
|
|
$timestr = time_str(time(0)); |
|
|
|
|
|
|
75
|
|
|
$title = "hr_class summary list at ".$timestr; |
|
76
|
|
|
|
|
77
|
|
|
admin_page_head($title); |
|
78
|
|
|
|
|
79
|
|
|
start_table(); |
|
80
|
|
|
|
|
81
|
|
|
table_header( |
|
82
|
|
|
"hr_class", "System", "CPU", "# unsent results" |
|
83
|
|
|
); |
|
84
|
|
|
|
|
85
|
|
|
$unsentresults = get_mysql_count( 0 ); |
|
86
|
|
|
table_row( |
|
87
|
|
|
make_reset_url(0), $system_string[ 128 ], $cpu_string[ 0 ], $unsentresults ); |
|
|
|
|
|
|
88
|
|
|
|
|
89
|
|
|
for ($system = 2; $system < 6; ++$system ) { |
|
|
|
|
|
|
90
|
|
|
for ($cpu = 1; $cpu < 22; ++$cpu ) { |
|
|
|
|
|
|
91
|
|
|
$hr_class=128*$system+$cpu; |
|
92
|
|
|
|
|
93
|
|
|
$unsentresults = get_mysql_count( $hr_class ); |
|
94
|
|
|
|
|
95
|
|
|
table_row( |
|
96
|
|
|
make_reset_url($hr_class), |
|
97
|
|
|
$system_string[$system * 128], |
|
98
|
|
|
$cpu_string[$cpu], |
|
99
|
|
|
$unsentresults |
|
100
|
|
|
); |
|
101
|
|
|
} |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
end_table(); |
|
105
|
|
|
|
|
106
|
|
|
admin_page_tail(); |
|
107
|
|
|
|
|
108
|
|
|
?> |
|
109
|
|
|
|