HalosGhost / dstat

A lightweight status program for simple WMs
GNU General Public License v2.0
8 stars 0 forks source link

Smooth estimated time till {replenish,deplet}ed #11

Closed HalosGhost closed 6 years ago

HalosGhost commented 6 years ago

Curl has had the ETA algorithm problem solved for quite some time.

Roughly speaking, you keep a running average of the rate; if the rate stays constant, you remove the passed time since last-sample. Else, the ETA will be adjusted to match the running average (higher-than-average rate: ETA jumps down; lower-than-average rate: ETA jumps up).

Over a relatively short period of time, this becomes shockingly precise. Even if we only kept the running average from execution time, it would quickly become great.

HalosGhost commented 6 years ago

via https://github.com/HalosGhost/dstat/commit/6cb873eef39be01ab58a677dca5859c818ce553e