mirror of
https://github.com/nmap/nmap.git
synced 2026-11-20 08:31:35 +08:00
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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user