Skip to content
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

Cache results to prevent miscalculations #13

Closed

Conversation

jgeralnik
Copy link

The code assumes that the status bar will only be updated every
status-interval seconds

In practice status-interval is a maximum value, not a minimum value. So
if the status bar is actually updated every second even though the
configuration is for 5 seconds all of the calculations are off and the
bitrate will be calculated as a fifth of the real rate.

See tmux-plugins/tmux-cpu#15 for a similar
issue with a different plugin, except that here it is much worse because
it actually leads to a WRONG RESULT and not just a faster update. This
commit implements @BrainMaestro 's suggestion from that thread.

Has some file spam for keeping track of everything needed but I'm only adding to an existing problem.

The code assumes that the status bar will only be updated every
status-interval seconds

In practice status-interval is a maximum value, not a minimum value. So
if the status bar is actually updated every second even though the
configuration is for 5 seconds all of the calculations are off and the
bitrate will be calculated as a fifth of the real rate.

See tmux-plugins/tmux-cpu#15 for a similar
issue with a different plugin, except that here it is much worse because
it actually leads to a WRONG RESULT and not just a faster update. This
commit implements @BrainMaestro 's suggestion from that thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant