You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get the network statistics for all running processes that are owned by a specific user. psutil.net_io_counters(pernic=True) seems like a really great option for me, but I'd like to get this information for everything in /proc. The psutil.process_iter() seems like a nice way to navigate /proc but it's missing net_io_counters as an attribute. Am I missing something, or would I need to add this functionality to the library?
I'm looking for something like this:
import psutil
for proc in psutil.process_iter():
try:
pinfo = proc.as_dict(attrs=['username', 'net_io_counters'])
except psutil.NoSuchProcess:
pass
else:
print(pinfo)
The text was updated successfully, but these errors were encountered:
I'm going to assume what I'm looking for (network statistics of a single process, rather than system wide network usage) is probably outside of the scope of psutil. Closing...
I want to get the network statistics for all running processes that are owned by a specific user.
psutil.net_io_counters(pernic=True)
seems like a really great option for me, but I'd like to get this information for everything in/proc
. Thepsutil.process_iter()
seems like a nice way to navigate/proc
but it's missingnet_io_counters
as an attribute. Am I missing something, or would I need to add this functionality to the library?I'm looking for something like this:
The text was updated successfully, but these errors were encountered: