-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Easy way to update the ETA of Bars #65
Comments
i don't understand the issue: the ETA value is automatically calculated and cannot be altered. if you want to use a different algorithm please use the payload feature to add custom values |
the problem i have is that i have no use for a bar that only updates the eta when the bar actually has an increment of at least 1. the code i posted in the first post basically forces the progressbar to recalculate the eta every second. example: lets say i have a bar with an end value of 200 and a start value of 0. in the first minute the bar fills up to the value of 199. the eta then says smth like 1second remaining. if the last increment to finish the bar takes 2hours tho (so 199->200) the eta will say |
the eta calculation wont work in case all values are identically (long running processes) - your code above will cause this behaviour |
so the calculation does work cause its a valid estimate. and its better than being stuck at the last time the value got updated |
it's only an edge case that it works for you....cli progress eta calculation is not designed for extreme long running processes. if you like i can add an additional method like |
would be practical. and my example was admittedly chosen as an exaggerated edge case but in my use case of a 2minute runnibg process it aso look like the script hangs every now and then due to the eta not refreshing. it would be nice to have a method to uodate the eta |
i've added two new features to the master branch:
Example const _progress = require('./cli-progress');
const _terminal = require('./lib/terminal');
// 50s/2 => new value expected within 25s
const p1 = new _progress.SingleBar({
fps: 2,
etaBuffer: 50,
etaAsynchronousUpdate: true
}, _progress.Presets.shades_classic);
p1.start(100, 50); |
I'd be great if the unit was mentioned in the README. It wasn't until here where I understood that the etaBuffer is in seconds! |
etaBuffer is NOT in seconds, it's just the buffer size |
|
size of elements within the buffer |
When is a new element added to the buffer? |
depends on the settings |
I have not found a simple way to update the ETA value of a bar except for doing this
where
progBar
is an instance of theSingleBar
class.I have tried using the
<Bar>.render()
method and<Bar>.update(0)
(which just resets the bar every time).This is only a problem when the script solely relies on
<Bar>.increment()
and does not count the current value itself. If the script does count the current value itself one can simply use<Bar>.update(value)
The text was updated successfully, but these errors were encountered: