Issue 250 in psutil: Add network interface speed information

16 views
Skip to first unread message

psu...@googlecode.com

unread,
Jan 30, 2012, 9:15:05 AM1/30/12
to psutil-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium

New issue 250 by nicolash...@gmail.com: Add network interface speed
information
http://code.google.com/p/psutil/issues/detail?id=250

Proposal

Add the network interface spped (100 Mbps, 1000 Mbps...) in the structure
returned by the psutil.network_io_counters(True) function

On what platforms would this be available?

Any

Proposed API

-

Are there existent implementations we can use as an example?

# python
# import statgrab
# statgrab.sg_get_network_iface_stats()
[{'duplex': 2, 'interface_name': 'lo', 'speed': 0, 'up': 1}, {'duplex':
0, 'interface_name': 'eth0', 'speed': 100, 'up': 1}, {'duplex':
2, 'interface_name': 'wlan0', 'speed': 0, 'up': 1}, {'duplex':
2, 'interface_name': 'virbr0', 'speed': 0, 'up': 1}]

Please provide any additional information below.

-


psu...@googlecode.com

unread,
Jan 30, 2012, 9:39:13 AM1/30/12
to psutil-...@googlegroups.com

Comment #1 on issue 250 by g.rodola: Add network interface speed information
http://code.google.com/p/psutil/issues/detail?id=250

This reminds me of issue 204 (get NICs ip/subnet/broadcast/gateway
addresses) which we decided to reject:
http://code.google.com/p/psutil/issues/detail?id=204#c6

I believe this is pretty hard to implement on all platforms.
Also, the kind of network info you can extract change depending on the
platform; as such it's not immediately clear what API this should have.
Last: is this really useful? IMO, it isn't (can't think of a use case).


psu...@googlecode.com

unread,
Jan 30, 2012, 9:48:15 AM1/30/12
to psutil-...@googlegroups.com

Comment #2 on issue 250 by nicolash...@gmail.com: Add network interface
speed information
http://code.google.com/p/psutil/issues/detail?id=250

I use it to display alerts in Glances
(https://github.com/nicolargo/glances). For exemple, when the network
bitrate of a 100 Mbps interface is higher than 70 Mbps then the stat is
displayed using a WARNING color.

In Glances v2.0, i want to replace StatGrab by PsUtil :)


psu...@googlecode.com

unread,
Jan 30, 2012, 10:13:27 AM1/30/12
to psutil-...@googlegroups.com

Comment #3 on issue 250 by g.rodola: Add network interface speed information
http://code.google.com/p/psutil/issues/detail?id=250

Interesting (and Glances looks like a nice tool).
So exactly what info are you proposing to extract from the NICs?
Just the bitrate? What do 'duplex' and 'up' parameters represent?
Being these per-NIC info only we should provide a new function (!= current
network_io_counters()).

psu...@googlecode.com

unread,
Jan 30, 2012, 10:17:29 AM1/30/12
to psutil-...@googlegroups.com

Comment #4 on issue 250 by nicolash...@gmail.com: Add network interface
speed information
http://code.google.com/p/psutil/issues/detail?id=250

I only use the maximum bitrate of the network interface.

I just create a wiki page for the Statgrab to PsUtil works:
https://github.com/nicolargo/glances/wiki/Study:-replace-StatGrab-by-PSUtil

Nicolas

psu...@googlecode.com

unread,
Feb 24, 2013, 5:32:52 PM2/24/13
to psutil-...@googlegroups.com
Updates:
Status: Accepted

Comment #5 on issue 250 by g.rodola: Add network interface speed information
http://code.google.com/p/psutil/issues/detail?id=250

Marking it as 'accepted'.
Ideally we'd have a nics_info() function (or network_ifaces_info() in order
to remain consistent with network_io_counters()) along these lines:

>>> psutil.nics_info()
{'lo':info(speed=100, up=True, duplex=2),
'eth0':info(speed=100, up=True, duplex=2),
... }

Still have to look into implementation details on every platform though.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

psu...@googlecode.com

unread,
Mar 3, 2013, 6:18:34 AM3/3/13
to psutil-...@googlegroups.com
Updates:
Status: Started

Comment #6 on issue 250 by g.rodola: Add network interface speed information
http://code.google.com/p/psutil/issues/detail?id=250

I created a separate hg branch for this and started with the Linux
implementation committed as revision 60843072901f.

psu...@googlecode.com

unread,
May 26, 2014, 11:16:05 AM5/26/14
to psutil-...@googlegroups.com

Comment #7 on issue 250 by g.rodola: Add network interface speed information
http://code.google.com/p/psutil/issues/detail?id=250

psutil has been migrated from Google Code to Github (see:
http://grodola.blogspot.com/2014/05/goodbye-google-code-im-moving-to-github.html).
Please do NOT reply here but use this instead:
https://github.com/giampaolo/psutil/issues/250
Reply all
Reply to author
Forward
0 new messages