Skip to content
Snippets Groups Projects
Commit 8c22fe84 authored by Brian O'Connor's avatar Brian O'Connor
Browse files

fixed iperf output parsing, changed to csv format

fixes #191
parent 9ff453a5
No related branches found
No related tags found
No related merge requests found
......@@ -315,11 +315,12 @@ def __init__( self, net, parent=None, width=4 ):
def updateGraph( self, _console, output ):
"Update our graph."
m = re.search( r'(\d+) Mbits/sec', output )
if not m:
vals = output.split(',')
if not len(vals) == 9:
return
self.updates += 1
self.bw += .001 * float( m.group( 1 ) )
#convert to Gbps
self.bw += int( vals[-1] ) * ( 10 ** -9 )
if self.updates >= self.hostCount:
self.graph.addBar( self.bw )
self.bw = 0
......@@ -416,7 +417,7 @@ def iperf( self ):
for console in consoles:
i = ( i + 1 ) % count
ip = consoles[ i ].node.IP()
console.sendCmd( 'iperf -t 99999 -i 1 -c ' + ip )
console.sendCmd( 'iperf -t 99999 -i 1 -y c -c ' + ip )
def stop( self, wait=True ):
"Interrupt all hosts."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment