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

[BUG] EWW_NET is all 0 #1070

Open
3 tasks done
danjenson opened this issue Apr 10, 2024 · 4 comments · May be fixed by #1108
Open
3 tasks done

[BUG] EWW_NET is all 0 #1070

danjenson opened this issue Apr 10, 2024 · 4 comments · May be fixed by #1108
Labels
bug Something isn't working

Comments

@danjenson
Copy link

Checklist before submitting an issue

  • I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • I have specifically verified that this bug is not a common user error
  • I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

EWW_NET magic variable return 0 for all interfaces, despite btop showing traffic and ping explicitly run to create traffic on target interface.

image

Reproducing the issue

Just updated to the most recent version of eww.

Expected behaviour

EWW_NET should be populated.

Additional context

No response

@danjenson danjenson added the bug Something isn't working label Apr 10, 2024
@hertg
Copy link

hertg commented Apr 18, 2024

Can confirm, updated to version 0.5.0 and got this bug, same for the latest git commit

@harshkhandeparkar
Copy link

This seems like an issue with the sysinfo crate. I tried logging the old_rx_bytes and rx_bytes the crate keeps track of to find the number of bytes received since the last refresh and they were equal. Can anyone confirm whether this is true so we can open an issue in the upstream repo?

In the meantime, we can keep track of the total bytes received (which is correct), and calculate the difference in eww. The total bytes could also be exported in the EWW_NET magic var this way.

@harshkhandeparkar
Copy link

Another workaround would be to get the total bytes before and after running the networks.refresh().

@mario-kr
Copy link

mario-kr commented Jun 3, 2024

I had a look at the source code of the sysinfo crate.
It seems both the refresh and refresh_list functions on the Networks struct update the data.

eww (via

pub fn net() -> String {
) calls both right after each other.

The fix would be deleting one of those function calls.

refresh_list also updates the list of interfaces. Those rarely change on a typical system, but keeping refresh_list would be closer to the behaviour pre 0.5.0.

refresh only updates the data for the currently known interfaces, which might perform slightly better, but probably only negligible.

@mario-kr mario-kr linked a pull request Jun 4, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants