Files
pv/doc
lemonsqueeze 06824aee2d Fixed inaccurate ETAs: use current average rate over last 30 seconds instead of global rate
using global rate gives wildly inacurrate ETAs if rate changes over time.

this makes pv keep a history of progress over the last 30s interval and compute
current average rate over that, which fixes the issue.

fixed -a, --average-rate: show current average rate instead of global rate

[ quick test ]

- in one shell:
    $ dd if=/dev/zero of=/tmp/foo bs=1M count=5                 # simulate fast initial rate,
    $ (while true; do ls /*; sleep 1; done) >> /tmp/foo         # then slow rate. leave running ...

- in another shell:
    $ tail -f -n +1 /tmp/foo | pv -s 800M > /dev/null

    5.62MiB 0:00:17 [33.1KiB/s] [>                              ]  0% ETA 0:40:02
        bad:  (pv 1.6.6 - 1.6.20)
        ETA of a few minutes that keeps increasing ever and ever ...

    5.62MiB 0:00:16 [33.1KiB/s] [>                              ]  0% ETA 6:45:53
        good:
        ETA of 6+ hours, which is how long it'll take to reach 800Mb at 33k/s
2023-05-29 15:09:36 +02:00
..
2021-09-04 20:51:25 +01:00
2021-09-04 20:51:25 +01:00
2021-09-12 17:13:24 +01:00
2021-09-04 20:51:25 +01:00