- client: update of time stats was broken by [17166]

svn path=/trunk/boinc/; revision=19009
This commit is contained in:
David Anderson 2009-09-06 05:11:26 +00:00
parent ae3f3e74f1
commit ed30b45a43
2 changed files with 13 additions and 2 deletions

View File

@ -7537,3 +7537,9 @@ David 5 Sept 2009
cpu_sched.cpp
html/inc/
result.inc
David 5 Sept 2009
- client: update of time stats was broken by [17166]
client/
time_stats.cpp

View File

@ -166,8 +166,6 @@ void TIME_STATS::update(int suspend_reason) {
} else {
dt = gstate.now - last_update;
if (dt <= 10) return;
if (dt > 100) return;
// client must have been suspended; skip
w1 = 1 - exp(-dt/ALPHA); // weight for recent period
w2 = 1 - w1; // weight for everything before that
// (close to zero if long gap)
@ -196,6 +194,13 @@ void TIME_STATS::update(int suspend_reason) {
sprintf(buf, "version %d.%d.%d", BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, BOINC_RELEASE);
log_append(buf, gstate.now);
log_append("power_on", gstate.now);
} else if (dt > 100) {
// large dt - the client or host must have been suspended
on_frac *= w2;
log_append("proc_stop", last_update);
if (is_active) {
log_append("proc_start", gstate.now);
}
} else {
on_frac = w1 + w2*on_frac;
if (connected_frac < 0) connected_frac = 0;