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

Network usage does not appear #4

Closed
qdii opened this issue Jun 23, 2016 · 9 comments
Closed

Network usage does not appear #4

qdii opened this issue Jun 23, 2016 · 9 comments

Comments

@qdii
Copy link

qdii commented Jun 23, 2016

screenshot: https://cloud.dodges.it/s/9ObN5dJguoLlloi
let me know how I can help you debug this

@elvetemedve
Copy link
Owner

Hi @qdii,

Actually listing most network heavy processes is not done. So it's a missing feature, and not a bug.

I did not find a way to get the network usage per process as a non-root user. There is a process level stat file provided by the kernel which lies, because the content of process level statistics /proc/1/net/netstat equals to the content in global /proc/net/netstat.
I tried to analyse Nethogs application and I found that it sniffs packets sent by applications and counts them. This operation needs root privilege. But I don't want to look into the packages, only interested in statistical data.

So if anyone can tell me a reliable method for accessing this data as regular user, then I would be able to implement this in the extension.

@qdii
Copy link
Author

qdii commented Jun 24, 2016

I understand, I will ask my colleagues if they have any idea on how to do that?
In the meantime, would it be very complicated to display download/upload speeds for the main interfaces? Maybe rate the speed over the last 5 seconds.

@elvetemedve
Copy link
Owner

It shouldn't be too difficult. I'll think about the possibilities.

@ghost
Copy link

ghost commented Sep 9, 2016

I have the same issue.

@bagage
Copy link

bagage commented Jan 17, 2017

I don't know any alternative to nethogs to do that, but one thing that could be done is that if:

  1. nethogs is installed and
  2. it has the capabilities to be run as non-root (eg user typed sudo setcap "cap_net_admin,cap_net_raw+pe" $(which nethogs)).

Then, system-monitor could use it to monitor network traffic. Do you think it would make sense?

@elvetemedve
Copy link
Owner

@bagage Well, it makes sense and that's possible. On the other hand I would like to rely on as less dependency as possible. Preferably:

  1. Utilise one of the Gnome libraries
  2. Obtain data directly from Linux kernel
  3. Utilise one of the libraries used by the OS
  4. Execute external software to get data

So it would be nice if GLibTop library could provide per process network usage information. Unfortunately only network interface level statistics is available.

@bagage
Copy link

bagage commented Jan 30, 2017

I totally agree with you - the upstream bug in GTop is Bug 768304. I added a comment on it to check current status.

@evfool
Copy link

evfool commented Jan 30, 2017

@elvetemedve @bagage thanks for the heads-up on this, I had this on my TODO list since a long time (as GNOME libgtop and system-monitor maintainer), will do my best to help you out with this.

@elvetemedve
Copy link
Owner

Showing network usage per interfaces has been implemented in version 9.

elvetemedve added a commit that referenced this issue Mar 21, 2023
When the extension is disabled, all observers must be removed which are
updating the GUI. It's not happening for widgets, which can cause errors
when terying to update a UI element after freeing.

Example:
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: clutter_text_get_editable: assertion 'CLUTTER_IS_TEXT (self)' failed
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: == Stack trace for context 0x559ef55c4180 ==
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: #0   559ef985b408 i   /home/geza/.local/share/gnome-shell/extensions/System_Monitor@bghome.gmail.com/widget.js:103 (58421c75a60 @ 18)
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: #1   559ef985b368 i   /home/geza/.local/share/gnome-shell/extensions/System_Monitor@bghome.gmail.com/widget.js:299 (58421c7a4c0 @ 51)
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: #2   559ef985b2b8 i   /home/geza/.local/share/gnome-shell/extensions/System_Monitor@bghome.gmail.com/widget.js:374 (58421c7a7e0 @ 22)
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: #3   7fff3eebcb40 b   /home/geza/.local/share/gnome-shell/extensions/System_Monitor@bghome.gmail.com/meter.js:44 (58421c68ba0 @ 127)
Mar 21 18:29:44 Geza-ThinkPad-T580 gnome-shell[72961]: #4   559ef985b228 i   /home/geza/.local/share/gnome-shell/extensions/System_Monitor@bghome.gmail.com/meter.js:80 (58421c68d80 @ 25)

The bug is caused by the wrong order of calling _destroyIcon() and
_destroyMeterWidget(), plus the if condition in the second function
which hides the problem.
The solution is to free items in reversed order compared to creation.
Meaning _destroyMeterWidget() should be called first and _destroyIcon() second.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants