Iperf: easily parseable real time output option

Created on 23 Jul 2016  ·  4Comments  ·  Source: esnet/iperf

Hi
I made a GUI for iperf 2 in Powershell:
https://github.com/ili101/PPerf

I want to add iperf 3 support but iperf 3 don't have a parseable real time output option

iperf 2 have CSV output
iperf 3 have JSON output but it's only updates at the end

I don't think JSON can support real time updates because of it's structure, probably why you are updating it only at the end.

Can you add CSV support or something with similar functionality?

Thank you

Help Wanted enhancement outputs

Most helpful comment

I would also like to see this feature. I understand the JSON structure can't be assembled until the end of the test, so maybe have a minimal JSON object for each reporting interval instead? Or bring back csv support for easy backward compatibility.

All 4 comments

I have managed to parse the text output
by cutting the data by the words starting index position on the [ ID] line
but you have a small bug that some of the lines data sometimes start before the header position

like the total and the 5.01-5.01 lines in this example

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 127.0.0.1, port 63781
[  6] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 64003
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  6]   0.00-1.01   sec   120 KBytes  0.98 Mbits/sec  0.136 ms  0/15 (0%)  
[  6]   1.01-2.01   sec   128 KBytes  1.05 Mbits/sec  0.137 ms  0/16 (0%)  
[  6]   2.01-3.01   sec   128 KBytes  1.05 Mbits/sec  0.169 ms  0/16 (0%)  
[  6]   3.01-4.01   sec   128 KBytes  1.05 Mbits/sec  0.126 ms  0/16 (0%)  
[  6]   4.01-5.01   sec   128 KBytes  1.04 Mbits/sec  0.113 ms  0/16 (0%)  
[  6]   5.01-5.01   sec  0.00 Bytes  0.00 Mbits/sec  0.113 ms  0/0 (0%)  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  6]   0.00-5.01   sec  0.00 Bytes  0.00 Mbits/sec  0.113 ms  0/79 (0%)  

I wonder if some of the output fields are justified in a funny way. Admittedly I haven't looked into this at all.

If I were going to try parsing this output, I might try instead breaking the line up into "words" separated by some amount of whitespace (rather than by position on the line). Think of the Perl or Python split commands, that's what I'm envisioning.

Breaking up the data line by the spaces will be hard because you then need to connect the "words" to there respected header and they will not mach up.
"0.00-1.01 sec" will be broke up to 2 words but its actually one cell data that is "Interval".

braking the data to cells by the header line position (then working on the cell string) is easier

Its not only a machine reading problem, it doesn't look good that some of the data is out of the "imagery table" cell and also don't line up with the other lines

I would also like to see this feature. I understand the JSON structure can't be assembled until the end of the test, so maybe have a minimal JSON object for each reporting interval instead? Or bring back csv support for easy backward compatibility.

Was this page helpful?
0 / 5 - 0 ratings