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

Fix: EWW_NET wrong values for TX/RX stats #1108

Merged
merged 2 commits into from
Aug 25, 2024

Commits on Aug 25, 2024

  1. Fix: EWW_NET wrong values for TX/RX stats

    The sysinfo crate, structure Networks, basically caches one value of
    total_received/total_transmitted each (as well as other metrics) and
    returns the difference between those two values when queried via the
    `received()` and `transmitted()` functions.
    
    These values are updated by both the `refresh()` and `refresh_list()`
    functions; so by calling both of them right after each other like
    previously done here, sets both the cached total_received/... and the
    current total_received/... to nearly the same value.
    
    `refresh_list()` also updates the list of interfaces on a host, with a
    marginally small performance impact for doing so (I measured slightly
    more than 100 microseconds on my machine (0.1 milliseconds), around
    20-25% more than with `refresh()`), especially considering this is run
    only every 2 seconds.
    mario-kr authored and elkowar committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    08742a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a96c0de View commit details
    Browse the repository at this point in the history