I am trying build Python module that will monitor and measure Ethernet speed (receive and send). This module is part of performance program. I looked for libraries that make it possible and the only library that i found is Psutil with the command:
psutil.net_io_counters(pernic=True)
The output for this command is :
'Ethernet 5': snetio(bytes_sent=211080874L, bytes_recv=929895370L, packets_sent=667031L, packets_recv=2757846L, errin=0L, errout=0L, dropin=0L, dropout=0L),
'Loopback Pseudo-Interface 1': snetio(bytes_sent=0L, bytes_recv=0L, packets_sent=0L, packets_recv=0L, errin=0L, errout=0L, dropin=0L, dropout=0L),
'isatap.replay.local': snetio(bytes_sent=0L, bytes_recv=0L, packets_sent=0L, packets_recv=0L, errin=0L, errout=0L, dropin=0L, dropout=0L)
So I got just bytes amount without knowing anything about time interval of the command measuring,so i can not extract from it the speed.
Which libraries are relevant to my task? how can i extract Ethernet speed with python script? Is there maybe CMD command that simplify the task?