elvetemedve / gnome-shell-extension-system-monitor

Gnome Shell extension for displaying resource usage
GNU General Public License v3.0
87 stars 15 forks source link

Network usage does not appear #4

Closed qdii closed 7 years ago

qdii commented 8 years ago

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

elvetemedve commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

ghost commented 7 years ago

I have the same issue.

bagage commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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

evfool commented 7 years ago

@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 commented 7 years ago

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