mirror of https://github.com/BOINC/boinc.git
added user_create_time, user_total_credit, user_expavgcredit, host_create_time, host_total_credit, host_expavgcredit, user country
to scheduler_reply and local structs in client. svn path=/trunk/boinc/; revision=520
This commit is contained in:
parent
4512fe9bcc
commit
dcb7cfcbb7
|
@ -112,7 +112,7 @@ zip:
|
|||
cd $(topsrcdir)/..; zip boinc_client.zip $(ARCHIVE_TARGETS)
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGS) core dependencies Makefile config.cache
|
||||
rm -f *.o $(PROGS) core dependencies config.cache
|
||||
cd ../RSAEuro/source; ${MAKE} clean;
|
||||
cd ../lib; ${MAKE} clean;
|
||||
cd ../api; ${MAKE} clean;
|
||||
|
|
|
@ -37,10 +37,14 @@ PROJECT::PROJECT() {
|
|||
resource_share = 0;
|
||||
strcpy(project_name,"");
|
||||
strcpy(user_name,"");
|
||||
total_credit = 0;
|
||||
expavg_credit = 0;
|
||||
user_total_credit = 0;
|
||||
user_expavg_credit = 0;
|
||||
user_create_time = 0;
|
||||
rpc_seqno = 0;
|
||||
hostid = 0;
|
||||
host_total_credit = 0;
|
||||
host_expavg_credit = 0;
|
||||
host_create_time = 0;
|
||||
exp_avg_cpu = 0;
|
||||
exp_avg_mod_time = 0;
|
||||
code_sign_key = NULL;
|
||||
|
@ -104,10 +108,14 @@ int PROJECT::parse_state(FILE* in) {
|
|||
else if (parse_str(buf, "<master_url>", master_url, sizeof(master_url))) continue;
|
||||
else if (parse_str(buf, "<project_name>", project_name, sizeof(project_name))) continue;
|
||||
else if (parse_str(buf, "<user_name>", user_name, sizeof(user_name))) continue;
|
||||
else if (parse_double(buf, "<total_credit>", total_credit)) continue;
|
||||
else if (parse_double(buf, "<expavg_credit>", expavg_credit)) continue;
|
||||
else if (parse_double(buf, "<user_total_credit>", user_total_credit)) continue;
|
||||
else if (parse_double(buf, "<user_expavg_credit>", user_expavg_credit)) continue;
|
||||
else if (parse_int(buf, "<user_create_time>", (int)user_create_time)) continue;
|
||||
else if (parse_int(buf, "<rpc_seqno>", rpc_seqno)) continue;
|
||||
else if (parse_int(buf, "<hostid>", hostid)) continue;
|
||||
else if (parse_double(buf, "<host_total_credit>", host_total_credit)) continue;
|
||||
else if (parse_double(buf, "<host_expavg_credit>", host_expavg_credit)) continue;
|
||||
else if (parse_int(buf, "<host_create_time>", (int)host_create_time)) continue;
|
||||
else if (parse_double(buf, "<exp_avg_cpu>", exp_avg_cpu)) continue;
|
||||
else if (parse_int(buf, "<exp_avg_mod_time>", exp_avg_mod_time)) continue;
|
||||
else if (match_tag(buf, "<code_sign_key>")) {
|
||||
|
@ -139,10 +147,14 @@ int PROJECT::write_state(FILE* out) {
|
|||
" <master_url>%s</master_url>\n"
|
||||
" <project_name>%s</project_name>\n"
|
||||
" <user_name>%s</user_name>\n"
|
||||
" <total_credit>%f</total_credit>\n"
|
||||
" <expavg_credit>%f</expavg_credit>\n"
|
||||
" <user_total_credit>%f</user_total_credit>\n"
|
||||
" <user_expavg_credit>%f</user_expavg_credit>\n"
|
||||
" <user_create_time>%d</user_create_time>\n"
|
||||
" <rpc_seqno>%d</rpc_seqno>\n"
|
||||
" <hostid>%d</hostid>\n"
|
||||
" <host_total_credit>%f</host_total_credit>\n"
|
||||
" <host_expavg_credit>%f</host_expavg_credit>\n"
|
||||
" <host_create_time>%d</host_create_time>\n"
|
||||
" <exp_avg_cpu>%f</exp_avg_cpu>\n"
|
||||
" <exp_avg_mod_time>%d</exp_avg_mod_time>\n"
|
||||
" <nrpc_failures>%d</nrpc_failures>\n"
|
||||
|
@ -150,10 +162,14 @@ int PROJECT::write_state(FILE* out) {
|
|||
master_url,
|
||||
project_name,
|
||||
user_name,
|
||||
total_credit,
|
||||
expavg_credit,
|
||||
user_total_credit,
|
||||
user_expavg_credit,
|
||||
user_create_time,
|
||||
rpc_seqno,
|
||||
hostid,
|
||||
host_total_credit,
|
||||
host_expavg_credit,
|
||||
host_create_time,
|
||||
exp_avg_cpu,
|
||||
exp_avg_mod_time,
|
||||
nrpc_failures,
|
||||
|
@ -176,10 +192,14 @@ void PROJECT::copy_state_fields(PROJECT& p) {
|
|||
scheduler_urls = p.scheduler_urls;
|
||||
strcpy(project_name, p.project_name);
|
||||
strcpy(user_name, p.user_name);
|
||||
total_credit = p.total_credit;
|
||||
expavg_credit = p.expavg_credit;
|
||||
user_total_credit = p.user_total_credit;
|
||||
user_expavg_credit = p.user_expavg_credit;
|
||||
user_create_time = p.user_create_time;
|
||||
rpc_seqno = p.rpc_seqno;
|
||||
hostid = p.hostid;
|
||||
host_total_credit = p.host_total_credit;
|
||||
host_expavg_credit = p.host_expavg_credit;
|
||||
host_create_time = p.host_create_time;
|
||||
exp_avg_cpu = p.exp_avg_cpu;
|
||||
exp_avg_mod_time = p.exp_avg_mod_time;
|
||||
if (p.code_sign_key) {
|
||||
|
|
|
@ -61,10 +61,14 @@ public:
|
|||
vector<STRING256> scheduler_urls; // where to find scheduling servers
|
||||
char project_name[256]; // descriptive. not unique
|
||||
char user_name[256];
|
||||
double total_credit; // as reported by server
|
||||
double expavg_credit; // as reported by server
|
||||
double user_total_credit; // as reported by server
|
||||
double user_expavg_credit; // as reported by server
|
||||
unsigned int user_create_time; // as reported by server
|
||||
int rpc_seqno;
|
||||
int hostid;
|
||||
double host_total_credit; // as reported by server
|
||||
double host_expavg_credit; // as reported by server
|
||||
unsigned int host_create_time; // as reported by server
|
||||
double exp_avg_cpu; // exponentially weighted CPU time
|
||||
int exp_avg_mod_time; // last time average was changed
|
||||
char* code_sign_key;
|
||||
|
|
|
@ -310,8 +310,9 @@ void CLIENT_STATE::handle_scheduler_reply(
|
|||
if (strlen(sr.user_name)) {
|
||||
strcpy(project->user_name, sr.user_name);
|
||||
}
|
||||
project->total_credit = sr.total_credit;
|
||||
project->expavg_credit = sr.expavg_credit;
|
||||
project->user_total_credit = sr.user_total_credit;
|
||||
project->user_expavg_credit = sr.user_expavg_credit;
|
||||
project->user_create_time = sr.user_create_time;
|
||||
if (strlen(sr.message)) {
|
||||
show_message(sr.message, sr.message_priority);
|
||||
}
|
||||
|
@ -322,6 +323,9 @@ void CLIENT_STATE::handle_scheduler_reply(
|
|||
|
||||
if (sr.hostid) {
|
||||
project->hostid = sr.hostid;
|
||||
project->host_total_credit = sr.host_total_credit;
|
||||
project->host_expavg_credit = sr.host_expavg_credit;
|
||||
project->host_create_time = sr.host_create_time;
|
||||
project->rpc_seqno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -406,12 +406,20 @@ int SCHEDULER_REPLY::parse(FILE* in) {
|
|||
continue;
|
||||
} else if (parse_str(buf, "<user_name>", user_name, sizeof(user_name))) {
|
||||
continue;
|
||||
} else if (parse_double(buf, "<total_credit>", total_credit)) {
|
||||
} else if (parse_double(buf, "<user_total_credit>", user_total_credit)) {
|
||||
continue;
|
||||
} else if (parse_double(buf, "<expavg_credit>", expavg_credit)) {
|
||||
} else if (parse_double(buf, "<user_expavg_credit>", user_expavg_credit)) {
|
||||
continue;
|
||||
} else if (parse_int(buf, "<user_create_time>", (int)user_create_time)) {
|
||||
continue;
|
||||
} else if (parse_int(buf, "<hostid>", hostid)) {
|
||||
continue;
|
||||
} else if (parse_double(buf, "<host_total_credit>", host_total_credit)) {
|
||||
continue;
|
||||
} else if (parse_double(buf, "<host_expavg_credit>", host_expavg_credit)) {
|
||||
continue;
|
||||
} else if (parse_int(buf, "<host_create_time>", (int)host_create_time)) {
|
||||
continue;
|
||||
} else if (parse_int(buf, "<request_delay>", request_delay)) {
|
||||
continue;
|
||||
} else if (match_tag(buf, "<global_preferences>")) {
|
||||
|
|
|
@ -73,6 +73,9 @@ struct SCHEDULER_OP {
|
|||
|
||||
struct SCHEDULER_REPLY {
|
||||
int hostid;
|
||||
double host_total_credit;
|
||||
double host_expavg_credit;
|
||||
unsigned int host_create_time;
|
||||
int request_delay;
|
||||
char message[1024];
|
||||
char message_priority[256];
|
||||
|
@ -80,8 +83,9 @@ struct SCHEDULER_REPLY {
|
|||
char* global_prefs_xml; // not including <global_preferences> tags
|
||||
char* project_prefs_xml; // not including <project_preferences> tags
|
||||
char user_name[256];
|
||||
double total_credit;
|
||||
double expavg_credit;
|
||||
double user_total_credit;
|
||||
double user_expavg_credit;
|
||||
unsigned int user_create_time;
|
||||
vector<APP> apps;
|
||||
vector<FILE_INFO> file_infos;
|
||||
vector<APP_VERSION> app_versions;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "windows_cpp.h"
|
||||
|
||||
#include "http.h"
|
||||
|
@ -95,7 +96,6 @@ int main() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
while (1) {
|
||||
nxs.poll(100000, n);
|
||||
hos.poll();
|
||||
|
|
|
@ -70,6 +70,8 @@ function show_host($host) {
|
|||
$x = $host->timezone/3600;
|
||||
row("<b>Time zone: </b>", "UTC - $x hours");
|
||||
row("<b>Created: </b>", time_str($host->create_time));
|
||||
row("<b>Total Credit:(specific to project) </b>", $host->total_credit);
|
||||
row("<b>Recent Averaged Credit:(credits per second) </b>", $host->expavg_credit);
|
||||
row("<b>CPU: </b>", "$host->p_vendor $host->p_model");
|
||||
row("<b>Number of CPUs: </b>", $host->p_ncpus);
|
||||
row("<b>Operating System: </b>", "$host->os_name $host->os_version");
|
||||
|
|
|
@ -89,7 +89,7 @@ function random_string() {
|
|||
}
|
||||
|
||||
function print_country_select() {
|
||||
PassThru("/disks/milkyway/a/users/anderson/boinc/tools/country_select");
|
||||
PassThru("/disks/milkyway/a/users/anderson/boinc_cvs/boinc/tools/country_select");
|
||||
}
|
||||
|
||||
function print_page_header($title) {
|
||||
|
|
|
@ -489,6 +489,7 @@ void send_code_sign_key(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void process_request(
|
||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss,
|
||||
char* code_sign_key
|
||||
|
|
|
@ -120,11 +120,13 @@ int SCHEDULER_REPLY::write(FILE* fout) {
|
|||
|
||||
fprintf(fout,
|
||||
"<user_name>%s</user_name>\n"
|
||||
"<total_credit>%f</total_credit>\n"
|
||||
"<expavg_credit>%f</expavg_credit>\n",
|
||||
"<user_total_credit>%f</user_total_credit>\n"
|
||||
"<user_expavg_credit>%f</user_expavg_credit>\n"
|
||||
"<user_create_time>%d</user_create_time>\n",
|
||||
user.name,
|
||||
user.total_credit,
|
||||
user.expavg_credit
|
||||
user.expavg_credit,
|
||||
user.create_time
|
||||
);
|
||||
|
||||
if (request_delay) {
|
||||
|
@ -139,7 +141,16 @@ int SCHEDULER_REPLY::write(FILE* fout) {
|
|||
}
|
||||
|
||||
if (hostid) {
|
||||
fprintf(fout, "<hostid>%d</hostid>\n", hostid);
|
||||
fprintf(fout,
|
||||
"<hostid>%d</hostid>\n"
|
||||
"<host_total_credit>%f</host_total_credit>\n"
|
||||
"<host_expavg_credit>%f</host_expavg_credit>\n"
|
||||
"<host_create_time>%d</host_create_time>\n",
|
||||
hostid,
|
||||
host.total_credit,
|
||||
host.expavg_credit,
|
||||
host.create_time
|
||||
);
|
||||
}
|
||||
|
||||
if (send_global_prefs) {
|
||||
|
|
Loading…
Reference in New Issue