-
Notifications
You must be signed in to change notification settings - Fork 0
/
iperfplot.py
54 lines (39 loc) · 1.36 KB
/
iperfplot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import numpy as np
import matplotlib.pyplot as plt
# Read the data from the text file using NumPy
data1 = np.genfromtxt('ue1-iperf3-file', skip_header=4, usecols=(4, 5, 6,))
data2 = np.genfromtxt('ue2-iperf3-file', skip_header=4, usecols=(4, 5, 6,))
# Extract the columns into separate variables
transfer1 = data1[:, 0]
bandwidth1 = data1[:, 2]
transfer2 = data2[:, 0]
bandwidth2 = data2[:, 2]
for i in range(len(transfer1)):
if transfer1[i] > 10:
transfer1[i] /= 1024
if bandwidth1[i] > 90:
bandwidth1[i] /= 1024
for i in range(len(transfer2)):
if transfer2[i] > 10:
transfer2[i] /= 1024
if bandwidth2[i] > 90:
bandwidth2[i] /= 1024
for i in range(len(transfer3)):
if transfer3[i] > 10:
transfer3[i] /= 1024
if bandwidth3[i] > 90:
bandwidth3[i] /= 1024
#print(bandwidth)
#print(transfer)
# Plot the data
plt.plot( bandwidth1, label='Bandwidth1', linewidth=1)
#plt.plot( transfer1, label='Transfer1', linewidth=1)
plt.plot( bandwidth2, label = 'Bandwidth2', linewidth=1)
#plt.plot( transfer2, label = 'Transfer2', linewidth=1)
plt.xlabel('Time (sec)')
plt.ylabel('Throughput')
plt.legend(['Bandwidth1 - Mbits/sec', 'Bandwidth2 - Mbits/sec'])
#plt.savefig('Rate_Leg_Mali_SharesController.png')
#plt.savefig('Rate_Leg_Mali_SharesController.eps')
#plt.savefig('Rate_Leg_Mali_SharesController.pdf')
plt.show()