Skip to content

Repository files navigation

iperfPlotter

This repo wasn't maintained since the last 5 years, trying to add some little things that I need.

1.Introduction

Iperf3 plotter is a graphing tool to generate statistical chart for iperf3 experimental result. Iperf3 output json file as result, which is not easy to view straightforwardly. This plotter will transform json data into line chart, box chart and csv file with better explanation power.

2.Requirements

Ipef3 plotter runs on Python, version 2.7+ and 3.3+. Plotting requires matplotlib, pandas, numpy and seaborn to be pre-installed. Replace pip wit pip3 if python3 is used.

pip install -r requirements.txt

3.Quick start

Suppose we have prepared a folder, iperfPlot. Inside iperfPlot, we prepared two folders graph and testTarball. The testTarball contains iperf3 ouput json files named as tg_server_id.

iperf3 -c 10.99.99.1 -Z -i 1 -A 1 -t 600 -J > tg_server_00018

One json file corresponding to 1 iperf connection. The iperf3_plot.py will transform testTarball data into statistical charts, located in graph.

cheryltekiMacBook-Pro-2:iperfPlot cheryl$ tree
.
|____graph
|____iperf3_plot.py
|____testTarball
| |____tg_server_00000
| |____tg_server_00001
| |____tg_server_00002
.....
| |____tg_server_00018
| |____tg_server_00019
| |____tg_server_00020

Run the following command.

python3 iperf3_plot.py -f ./testTarball -o graph/all.png

In default, iperf3 plotter will generate chart, box, statistical summary and a transformed csv.

cheryltekiMacBook-Pro-2:iperfPlot cheryl$ python3 iperf3_plot.py -f ./testTarball -o graph/all.png
['tg_server_00000', 'tg_server_00001', 'tg_server_00002', 'tg_server_00003', 'tg_server_00004', 'tg_server_00005', 'tg_server_00006', 'tg_server_00007', 'tg_server_00008', 'tg_server_00009', 'tg_server_00010', 'tg_server_00011', 'tg_server_00012', 'tg_server_00013', 'tg_server_00014', 'tg_server_00015', 'tg_server_00016', 'tg_server_00017', 'tg_server_00018', 'tg_server_00019', 'tg_server_00020']
cheryltekiMacBook-Pro-2:iperfPlot cheryl$ cd graph
cheryltekiMacBook-Pro-2:graph cheryl$ tree
.
|____all.png
|____all.png.csv
|____all.png_stats.csv
|____all_box.png
|____all_line_0.png
|____all_line_10.png
|____all_line_15.png
|____all_line_20.png
|____all_line_5.png

4.Configuration

cheryltekiMacBook-Pro-2:iperfPlot cheryl$ python3 iperf3_plot.py -h
Usage: iperf3_plot.py [ -f FOLDER | -o OUT | -p PLOTFILES | -n NOPLOTFILES | -v ]
Options:
-h, --help show this help message and exit
-f FILE, --folder=FILE
Input folder absolute path. [Input Format: /Users/iperfExp]
-o OUT, --output=OUT Plot file name. [Input Format: iperf.png]
-p PLOT_FILES, --plotfiles=PLOT_FILES
Choose files to be plotted. If no specified, all files in folder. [Input Format: f1,f2,f3]
-n NO_PLOT_FILES, --noPlotFiles=NO_PLOT_FILES
Choose files not to be plotted. [Input Format: f1,f2,f3]
-u UPPER_LIMIT, --upperLimit=UPPER_LIMIT
The expected upper boundary. [Input Format: 0.5]
-l LOWER_LIMIT, --lowerLimit=LOWER_LIMIT
The expected lower boundary. [Input Format: 0.5]
-b BOUND, --bound=BOUND
Provide multiple bound in pairs. [Input Format: [upperbound, lowerbound, tag]
-v, --verbose Verbose debug output to stderr.

The parameters -f and -o are necessary, representing input source data folder and output folder respectively.

python3 iperf3_plot.py -f ./testTarball -o graph/all.png

Iperf3 plotter provides other flexible parameters for customizing different user scenarios. We list a few example here.

  • plot all lines in testTarball with boundary.

     python3 iperf3_plot.py -f testTarball -o graph/all.png \
    -b [0.42,0.42,0.42M],[0.46,0.46,0.46M] \
    -u 0.5 -l 0.45
    

    The boundary [0.42,0.42,0.42M],[0.46,0.46,0.46M] will applied on all.png. Boundary is denoted ad [upper bound,lower bound, boundary line label].

    The boundary 0.45 and 0.5 will applied on all_line_0.png ~ all_line_20.png.

    The -b is only applied to ouput_filename.png while -u and -l are only applied to output_filename_id.png.

  • plot only tg_server_00004,tg_server_00009 in testTarball.

     python3 iperf3_plot.py -f testTarball \
    -o graph/s49.png \
    -p tg_server_00004,tg_server_00009
    
  • plot all in testTarball except tg_server_00004,tg_client_00009

     python3 iperf3_plot.py -f testTarball \
    -o graph/s1419.png \
    -n tg_server_00004,tg_server_00009
    
  • plot tg_server_00004,tg_server_00009 in testTarball, plot boundary on individual line.

     python3 iperf3_plot.py -f testTarball \
    -o graph/s49_bound.png \
    -p tg_server_00004,tg_server_00009 \
    -u 0.5 \
    -l 0.45
    

5.Input Format

A sample input format can be referred at here.

{
"start": {
"timestamp": {
"timesecs": 1489032094,
"time": "Thu, 09 Mar 2017 04:01:34 GMT"
},
"system_info": "Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64",
"connected": [
{
"remote_port": 50243,
"local_port": 50001,
"local_host": "172.31.4.1",
"socket": 5,
"remote_host": "172.31.4.100"
}
],
"version": "iperf 3.1.3",
"cookie": "localhost.localdomain.1489032286.124",
"accepted_connection": {
"host": "172.31.4.100",
"port": 50202
},
"test_start": {
"blksize": 131072,
"blocks": 0,
"bytes": 0,
"protocol": "TCP",
"duration": 60,
"reverse": 0,
"num_streams": 1,
"omit": 0
},
"tcp_mss_default": 1320
},
...
"intervals": [
{
"streams": [
{
"start": 0,
"end": 1.000063,
"socket": 5,
"seconds": 1.000063,
"omitted": false,
"bytes": 50160,
"bits_per_second": 401254.648361
}
],
"sum": {
"start": 0,
"end": 1.000063,
"seconds": 1.000063,
"omitted": false,
"bytes": 50160,
"bits_per_second": 401254.648361
}
},
....
|

Currently, iperf3 plotter only plot iperf through put in Mbps. The following code describes how iperf3 plotter calculates throughput with given input json format.

def generate_BW(self, iperf):
"""Do the actual formatting."""
idx=[]
value=[]
duration = iperf.get('start').get('test_start').get('duration')
for i in iperf.get('intervals'):
for ii in i.get('streams'):
if (round(float(ii.get('start')), 0)) <= duration:
idx.append(round(float(ii.get('start')), 0))
value.append(round(float(ii.get('bits_per_second')) / (1024*1024), 3))
return pd.Series(value, index=idx)

6.Output Formats

We generate 3 types of graph: box chart, line chart and individual line chart. In addition, we also transform the json data into csv.

###6.1 Line chart Line chart has two types: the global view and individual view. Global view with boundaries helps user to decide whether each iperf connection throughput is inside the boundary range. The global view boundary is set by "-b".

global view

The individual view provides better way to check, filter and inspect whether an individual connection is located inside the boundary. The individual view boundary is set by "-u" and "-l". image

###6.2 box chart Box chart and *.png_stats.csv provide a simplified view to check the variance of each connection. The shorter the bar, the less number of outliers, the result is better. In terms of iperf scenario, better result means the data transmission is more stable. global view

statistic summary

tg_server_00000tg_server_00001tg_server_00002tg_server_00003tg_server_00004tg_server_00005tg_server_00006tg_server_00007tg_server_00008tg_server_00009tg_server_00010tg_server_00011tg_server_00012tg_server_00013tg_server_00014tg_server_00015tg_server_00016tg_server_00017tg_server_00018tg_server_00019tg_server_00020
count61.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.061.0
mean0.453819672131147540.451836065573770430.454147540983606550.45250819672131150.454147540983606550.45381967213114750.45183606557377050.453655737704918070.4526557377049180.4539836065573770.453819672131147540.45447540983606560.45349180327868850.452999999999999960.453655737704918070.45349180327868850.452819672131147540.4536557377049180.45283606557377050.4539836065573770.4538196721311476
std0.0091824255995194660.0221051881752292530.0123960155770228180.0155377207153212290.0134286212565720640.0112982420413108380.0190868020089527240.0104672270219984540.017603868178993730.0109094634809702210.0117324453215876380.0103014668168778260.0134692525786445340.0130384048104052930.0107809789999202470.0114638896116162260.0176536192669957580.0144762854879991410.0145478295378484240.0110611810750912250.013453014775780819
min0.4330.3020.4330.3830.4230.4230.3320.4330.3520.4330.4330.4330.4030.4030.4330.4230.3520.4230.3730.4230.423
25%0.4530.4430.4430.4430.4530.4430.4430.4430.4530.4430.4430.4530.4430.4430.4430.4430.4430.4430.4530.4530.443
50%0.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.4530.453
75%0.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.4630.463
max0.4730.4830.4830.4830.4930.4730.4830.4730.4830.4730.4830.4830.4830.4830.4830.4830.4730.4830.4730.4830.483

###6.3 Json to CSV Iperf3 plotter also transforms json data into csv format for better viewing the numbers.

iperf data

starttg_server_00000tg_server_00001tg_server_00002tg_server_00003tg_server_00004tg_server_00005tg_server_00006tg_server_00007tg_server_00008tg_server_00009tg_server_00010tg_server_00011tg_server_00012tg_server_00013tg_server_00014tg_server_00015tg_server_00016tg_server_00017tg_server_00018tg_server_00019tg_server_00020
0.00.4430.3020.4530.3830.4630.4330.3320.4730.3520.4630.4330.4630.4030.4030.4430.4430.3520.4230.3730.4430.433
1.00.4530.4530.4530.4230.4530.4630.4630.4330.4530.4530.4430.4530.4430.4230.4330.4330.4630.4530.4530.4630.453
2.00.4630.4630.4630.4530.4530.4530.4430.4530.4630.4530.4530.4630.4530.4530.4630.4530.4530.4530.4530.4530.453
3.00.4530.4530.4430.4530.4530.4530.4630.4530.4730.4730.4530.4430.4530.4530.4430.4630.4730.4530.4530.4530.463
4.00.4530.4430.4830.4630.4730.4530.4530.4730.4330.4330.4530.4730.4630.4530.4630.4530.4330.4530.4530.4530.443
5.00.4630.4630.4530.4530.4530.4630.4430.4330.4630.4530.4530.4530.4630.4530.4730.4530.4630.4530.4630.4530.463
6.00.4430.4530.4530.4830.4530.4430.4730.4430.4530.4630.4530.4430.4530.4730.4330.4530.4430.4530.4530.4830.453
7.00.4530.4730.4330.4330.4430.4530.4630.4530.4830.4630.4630.4530.4430.4430.4630.4630.4730.4530.4630.4230.483
8.00.4530.4330.4730.4730.4530.4530.4330.4530.4230.4430.4530.4630.4630.4430.4630.4630.4430.4530.4430.4730.433
9.00.4530.4630.4330.4230.4630.4630.4630.4630.4530.4530.4630.4430.4630.4530.4430.4330.4630.4730.4530.4430.453
10.00.4530.4430.4630.4530.4430.4430.4430.4530.4630.4630.4430.4530.4330.4530.4430.4530.4330.4330.4630.4630.443
11.00.4630.4730.4430.4630.4530.4530.4430.4630.4430.4430.4530.4730.4530.4830.4530.4530.4730.4830.4430.4330.473
12.00.4630.4430.4530.4430.4530.4530.4830.4430.4530.4530.4630.4330.4730.4330.4530.4530.4530.4230.4530.4530.433
13.00.4430.4430.4530.4630.4530.4730.4330.4630.4530.4730.4630.4530.4430.4630.4530.4630.4430.4830.4730.4730.453
14.00.4530.4630.4730.4530.4530.4530.4630.4530.4530.4330.4330.4530.4430.4530.4630.4530.4530.4430.4530.4530.453
15.00.4530.4530.4430.4530.4630.4530.4530.4430.4530.4530.4730.4630.4630.4430.4530.4630.4630.4630.4530.4530.453
16.00.4530.4430.4730.4530.4430.4530.4530.4630.4530.4530.4330.4530.4630.4730.4630.4430.4430.4430.4630.4530.473
17.00.4530.4630.4430.4530.4630.4630.4530.4430.4530.4530.4630.4530.4530.4430.4430.4530.4630.4430.4530.4430.443
18.00.4630.4630.4430.4530.4530.4330.4530.4630.4630.4730.4430.4630.4430.4430.4530.4630.4430.4730.4330.4530.453
19.00.4530.4430.4730.4630.4630.4730.4430.4530.4430.4430.4630.4430.4630.4530.4530.4430.4530.4430.4530.4630.453
20.00.4530.4530.4330.4630.4530.4330.4530.4530.4530.4630.4530.4530.4530.4530.4530.4630.4530.4630.4530.4530.453
21.00.4630.4530.4530.4430.4630.4730.4630.4630.4530.4430.4530.4530.4430.4730.4530.4430.4630.4430.4630.4530.453
22.00.4330.4830.4630.4630.4330.4430.4530.4430.4530.4630.4530.4530.4630.4530.4630.4630.4630.4430.4430.4530.463
23.00.4530.4430.4630.4430.4730.4430.4530.4530.4630.4430.4730.4730.4430.4530.4430.4430.4630.4630.4530.4530.463
24.00.4530.4430.4430.4430.4330.4730.4630.4530.4730.4530.4430.4330.4630.4430.4630.4730.4330.4730.4730.4630.453
25.00.4630.4430.4530.4630.4530.4730.4530.4530.4530.4530.4430.4630.4530.4630.4530.4530.4630.4430.4330.4430.433
26.00.4530.4530.4530.4630.4530.4230.4430.4630.4430.4530.4530.4730.4730.4430.4630.4630.4430.4430.4730.4630.473
27.00.4630.4630.4630.4430.4530.4530.4530.4530.4430.4730.4530.4330.4330.4630.4530.4630.4630.4530.4330.4430.453
28.00.4430.4630.4430.4630.4630.4530.4530.4430.4530.4330.4730.4630.4530.4430.4430.4230.4430.4630.4730.4530.453
29.00.4530.4430.4630.4430.4530.4530.4630.4630.4530.4530.4430.4630.4530.4530.4630.4530.4530.4630.4530.4630.443
30.00.4730.4530.4630.4530.4530.4630.4530.4430.4530.4530.4630.4430.4530.4630.4430.4630.4630.4530.4430.4430.463
31.00.4630.4630.4330.4530.4530.4430.4530.4630.4630.4630.4430.4430.4530.4430.4530.4430.4530.4330.4530.4630.443
32.00.4330.4430.4530.4630.4630.4630.4430.4730.4530.4630.4730.4530.4830.4630.4530.4630.4530.4630.4530.4630.463
33.00.4430.4530.4530.4430.4430.4430.4830.4330.4530.4430.4530.4530.4230.4630.4530.4430.4730.4530.4530.4430.443
34.00.4530.4530.4530.4630.4530.4730.4530.4530.4730.4730.4630.4530.4530.4730.4530.4730.4630.4530.4530.4530.463
35.00.4630.4530.4830.4630.4530.4430.4330.4530.4630.4430.4330.4630.4630.4330.4830.4530.4230.4630.4530.4530.453
36.00.4730.4630.4330.4430.4530.4530.4630.4730.4430.4430.4430.4530.4630.4430.4530.4530.4630.4430.4530.4630.453
37.00.4430.4430.4630.4530.4530.4630.4430.4330.4530.4530.4630.4530.4430.4530.4330.4430.4530.4530.4530.4430.483
38.00.4430.4730.4430.4530.4530.4430.4630.4530.4330.4530.4530.4630.4530.4530.4630.4530.4530.4530.4730.4630.423
39.00.4530.4530.4530.4530.4630.4630.4530.4630.4530.4730.4430.4430.4530.4530.4430.4630.4430.4530.4630.4430.463
40.00.4530.4630.4530.4530.4630.4530.4430.4530.4530.4330.4630.4530.4530.4530.4530.4630.4630.4530.4330.4530.453
41.00.4630.4430.4530.4530.4430.4530.4530.4530.4530.4730.4530.4530.4530.4630.4530.4430.4530.4530.4530.4830.453
42.00.4430.4430.4530.4630.4630.4530.4730.4530.4530.4430.4630.4530.4530.4530.4630.4530.4530.4530.4530.4330.453
43.00.4530.4630.4530.4430.4730.4430.4430.4530.4530.4630.4530.4530.4530.4630.4430.4530.4530.4830.4630.4530.473
44.00.4630.4430.4530.4530.4530.4530.4730.4530.4630.4530.4430.4630.4630.4530.4530.4430.4530.4230.4530.4530.423
45.00.4530.4530.4730.4530.4230.4630.4430.4530.4530.4530.4530.4430.4430.4530.4630.4730.4730.4730.4430.4530.463
46.00.4530.4530.4530.4630.4830.4530.4630.4630.4530.4430.4730.4830.4630.4530.4630.4430.4330.4830.4530.4530.453
47.00.4530.4530.4430.4530.4230.4630.4330.4430.4530.4630.4430.4430.4530.4530.4530.4630.4630.4530.4530.4530.463
48.00.4630.4530.4630.4530.4530.4530.4530.4730.4830.4530.4430.4430.4630.4530.4430.4530.4430.4330.4730.4530.443
49.00.4430.4730.4530.4730.4930.4430.4530.4530.4230.4430.4530.4530.4430.4530.4630.4530.4530.4330.4530.4530.463
50.00.4630.4430.4630.4530.4230.4630.4630.4430.4530.4630.4730.4630.4630.4730.4530.4430.4530.4630.4430.4630.443
51.00.4530.4630.4330.4430.4830.4430.4430.4430.4530.4430.4430.4530.4430.4430.4530.4530.4530.4430.4630.4530.463
52.00.4430.4430.4630.4430.4330.4530.4530.4530.4530.4630.4830.4430.4530.4530.4630.4530.4630.4530.4530.4430.443
53.00.4530.4630.4530.4830.4530.4630.4530.4630.4730.4630.4330.4530.4530.4430.4430.4530.4730.4730.4530.4530.483
54.00.4530.4530.4530.4230.4430.4530.4630.4730.4330.4430.4530.4630.4630.4530.4430.4530.4330.4330.4530.4630.443
55.00.4530.4430.4430.4730.4530.4530.4630.4430.4630.4530.4530.4630.4830.4530.4630.4530.4630.4530.4630.4530.433
56.00.4630.4530.4730.4430.4630.4530.4430.4430.4530.4530.4430.4430.4230.4530.4430.4730.4530.4630.4330.4530.463
57.00.4630.4530.4630.4730.4630.4530.4530.4530.4630.4530.4530.4530.4530.4630.4630.4530.4530.4530.4630.4530.453
58.00.4430.4530.4630.4330.4330.4630.4530.4530.4530.4630.4530.4530.4530.4430.4530.4430.4630.4730.4430.4730.453
59.00.4730.4730.4330.4530.4630.4730.4530.4630.4430.4430.4630.4630.4630.4830.4830.4830.4430.4530.4630.4330.473
60.00.4330.4630.4530.4630.4530.4330.4530.4430.4730.4530.4730.4630.4730.4530.4330.4230.4730.4530.4630.4630.443

7.Run robot framework test

robot --loglevel DEBUG iperf3_plot.robot

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages