I wrote an algorithm a few years ago to predict the time remaining in the imaging and multicast program that used a moving average with a reset when the current bandwidth went beyond a predetermined range. It will remain smooth if nothing sharp happens, then quickly adapts and returns to the moving average again. See an example chart here:

The thick blue line in this example diagram is the actual throughput over time. Pay attention to the low bandwidth during the first half of the transmission, and then it increases sharply in the second half. The orange line is the overall average. Note that it never adjusts far enough to give an accurate forecast of how long it will take to complete. The gray line is the moving average (i.e., the average of the last N data points - in this graph, N is 5, but in fact N may need to be increased for sufficient smoothing). It recovers faster, but still takes time to configure. This will take longer than more N. So if your data is quite noisy, then N should be longer and the recovery time will be longer.
The green line is the algorithm I used. This happens just like a moving average, but when the data goes beyond a predetermined range (indicated by light thin blue and yellow lines), it resets the moving average and immediately rises. The predefined range can also be based on standard deviation, so it can adjust the noise level of the data automatically. I just threw these values ββin Excel to build a diagram for this answer so that it is not perfect, but you get the idea.
Data can be invented so that this algorithm is not a good predictor of the remaining time. The bottom line is that you need to have a general idea of ββhow you expect the data to behave, and choose an algorithm accordingly. My algorithm worked well for the datasets I saw, so we continued to use it.
Another important tip: developers usually ignore setup and completion times in their progress indicators and time estimation calculations. This leads to a perpetual 99% or 100% progress bar that just sits there for a long time (while clearing caches or performing other cleaning work), or to preliminary estimates when directories are scanned or other configuration work is accumulated time. but not getting any percentage of progress that throws everything away. You can run several tests, which include installation and disassembly times, and estimate how much time is on average this time or based on the size of the job, and add this time to the progress bar. For example, the first 5% of the work is setup work, and the last 10% is disassembly work, and then 85% in the middle is the download or the repeating tracking process. That might help too.
rcronk Jun 15 '17 at 22:08 2017-06-15 22:08
source share