console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.23k stars 240 forks source link

per_sec and eta values fluctuate wildly from one tick to the next #494

Closed shssoichiro closed 1 year ago

shssoichiro commented 1 year ago

It seems that this originated in 71e7eaab9070f2cc34e9002074fe28c9f3fb371f.

The previous behavior was that the per_sec and eta values would be relatively steady throughout the life of the progress bar, as they simply calculated pos / (now - start_time).

The new behavior instead calculates (pos - prev_pos) / (now - prev_time). Since this no longer has the effect of averaging out fast and slow spikes since the start of the progress bar, it causes the values in per_sec and eta to fluctuate wildly between each tick. In my opinion, this is undesirable.

djc commented 1 year ago

I think this is the discussion in #394. It could really use someone to dig in and come up with a good plan, and I'm not sure I'll have time for that in the near term.

teor2345 commented 1 year ago

Closed by #539?

djc commented 1 year ago

Probably! If not, feel free to reopen.