Use exponential moving average for timing estimates

Time remaining estimates are now based on a moving average work unit
completion rate instead of percent completion of the entire task. This
better fits tasks that may increase the number of work units as time
goes on (such as increasing the number of retries for any given probe)
This commit is contained in:
dmiller
2026-07-01 02:06:12 +00:00
parent 87e8e270d1
commit bc4346dd87
11 changed files with 170 additions and 104 deletions
+4 -1
View File
@@ -265,8 +265,11 @@ struct Stats
void reset() {
servers = names = actual = ok = nx = sf = trans = dropped = system = 0;
}
int statDone() const {
return ok + nx + sf + dropped;
}
double getCompletion() const {
return (double) (ok + nx + sf + dropped) / actual;
return (double) statDone() / actual;
}
};