diff --git a/checkin_notes b/checkin_notes index 8d0c4d4657..26f3406f25 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 + diff --git a/sched/update_stats.C b/sched/update_stats.C index e838e763fb..2f6ababa61 100644 --- a/sched/update_stats.C +++ b/sched/update_stats.C @@ -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) {