update_stats program. Fix 'bug of omission' where member counts

of teams are calculated but were not written back into the database.
Also, change algorithm so that for hosts/teams/users, when the RAC
(Recent Average Credit) values have decayed to exactly 0.0 (double
precision) then neither expavg_credit nor expavg_time are updated.
In this way, by looking at the value of expavg_time, you can see
exactly WHEN the RAC decayed to zero.  This effectively indicates
the 'drop-out-date' for the host/team/user.

svn path=/trunk/boinc/; revision=9283
This commit is contained in:
Bruce Allen 2006-01-22 16:35:08 +00:00
parent e28d061d3b
commit 1e1d2f2d8e
2 changed files with 25 additions and 5 deletions

View File

@ -755,3 +755,16 @@ Charlie 21 Jan 2006
boinc.xcodeproj/
project.pbxproj
Bruce 22 Jan 2006
- update_stats program. Fix 'bug of omission' where member counts
of teams are calculated but were not written back into the database.
Also, change algorithm so that for hosts/teams/users, when the RAC
(Recent Average Credit) values have decayed to exactly 0.0 (double
precision) then neither expavg_credit nor expavg_time are updated.
In this way, by looking at the value of expavg_time, you can see
exactly WHEN the RAC decayed to zero. This effectively indicates
the 'drop-out-date' for the host/team/user.
sched/
update_stats.C

View File

@ -53,7 +53,7 @@ int update_users() {
char buf[256];
while (!user.enumerate()) {
if (user.expavg_time > update_time_cutoff) continue;
if (user.expavg_time > update_time_cutoff || user.expavg_credit==0.0) continue;
update_average(0, 0, CREDIT_HALF_LIFE, user.expavg_credit, user.expavg_time);
sprintf(
buf,"expavg_credit=%f, expavg_time=%f",
@ -75,7 +75,7 @@ int update_hosts() {
char buf[256];
while (!host.enumerate()) {
if (host.expavg_time > update_time_cutoff) continue;
if (host.expavg_time > update_time_cutoff || host.expavg_credit==0.0) continue;
update_average(0, 0, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time);
sprintf(
buf,"expavg_credit=%f, expavg_time=%f",
@ -103,6 +103,13 @@ int get_team_totals(TEAM& team) {
retval = user.count(nusers, buf);
if (retval) return retval;
if (team.nusers != nusers) {
log_messages.printf(
SCHED_MSG_LOG::MSG_CRITICAL,
"updating member count for [TEAM#%d]: database has %d users, count shows %d\n",
team.id, team.nusers, nusers
);
}
team.nusers = nusers;
return 0;
@ -128,12 +135,12 @@ int update_teams() {
);
continue;
}
if (team.expavg_time < update_time_cutoff) {
if (team.expavg_time < update_time_cutoff && team.expavg_credit!=0.0) {
update_average(0, 0, CREDIT_HALF_LIFE, team.expavg_credit, team.expavg_time);
}
sprintf(
buf, "expavg_credit=%f, expavg_time=%f",
team.expavg_credit, team.expavg_time
buf, "expavg_credit=%f, expavg_time=%f, nusers=%d",
team.expavg_credit, team.expavg_time, team.nusers
);
retval = team.update_field(buf);
if (retval) {