Commit 45a09f69 authored by Deathcrow's avatar Deathcrow

add netperf results aggregation

parent 1f7c9398
......@@ -56,7 +56,7 @@ def qsort1(list):
def quantil(list,p):
length = len(list)
len_p = length * p
len_p = (length * p)-1
if math.ceil(len_p) == len_p:
return ((list[int(len_p)] + list[int(len_p + 1)]) / 2)
else:
......@@ -85,6 +85,8 @@ args.folders = [os.path.abspath(folder) for folder in args.folders]
print(args.folders)
rtt_values_file = tempfile.TemporaryFile(mode='r+')
bw_values_file = tempfile.TemporaryFile(mode='r+')
netperf_throughput_file = tempfile.TemporaryFile(mode='r+')
netperf_retrans_file = tempfile.TemporaryFile(mode='r+')
rtt_file_lines = 0
bw_file_lines = 0
......@@ -106,10 +108,22 @@ for folder in args.folders:
bw_values_file.write(line[3])
bw_file_lines += 1
bw_file.close()
elif file[:8+len(args.mask)] == "netperf_"+args.mask:
netperf_file = open(path + "/" + file)
count = 0
for line in netperf_file:
count+=1
if count == 6:
netperf_throughput_file.write(line[11:])
elif count == 42:
netperf_retrans_file.write(line[24:])
netperf_file.close()
bw_values_file.seek(0)
rtt_values_file.seek(0)
netperf_throughput_file.seek(0)
netperf_retrans_file.seek(0)
def statify_list(sorted_list, n):
avg = sum( sorted_list ) / n
......@@ -168,13 +182,16 @@ def statify_list(sorted_list, n):
del sorted_list[len(sorted_list)-1]
else:
break
print("min. without outliers: "+str(sorted_list[0]))
print("max. without outliers: "+str(sorted_list[len(sorted_list)-1]))
print("Std. deviation without outliers: "+str(math.sqrt((1/(n - 1)) * sum( [ (value-avg)**2 for value in sorted_list ] ))))
return sorted_list
sorted_bw = sorted([ float(line) for line in bw_values_file ])
sorted_rtt = sorted([ float(line) for line in rtt_values_file ])
sorted_netperf_throughput = sorted([ float(line) for line in netperf_throughput_file ])
sorted_netperf_retrans = sorted([ float(line) for line in netperf_retrans_file ])
print("Bandwidth: ")
print("=============================")
sorted_bw = statify_list(sorted_bw, len(sorted_bw))
......@@ -182,13 +199,25 @@ print("")
print("Round Trip Time: ")
print("=============================")
sorted_rtt = statify_list(sorted_rtt, len(sorted_rtt))
print("")
print("Netperf Throughput: ")
print("=============================")
if len(sorted_netperf_throughput) == 1:
sorted_netperf_throughput += sorted_netperf_throughput
sorted_netperf_throughput = statify_list(sorted_netperf_throughput, len(sorted_netperf_throughput))
print("")
print("Netperf Retransmissions: ")
print("=============================")
if len(sorted_netperf_retrans) == 1:
sorted_netperf_retrans += sorted_netperf_retrans
sorted_netperf_retrans = statify_list(sorted_netperf_retrans, len(sorted_netperf_retrans))
from pylab import *
#from pylab import *
boxplot(sorted_bw)
show()
boxplot(sorted_rtt)
show()
#boxplot(sorted_bw)
#show()
#boxplot(sorted_rtt)
#show()
#rtt_q_25 = quantil(sorted_rtt, 0.25)
#rtt_q_75 = quantil(sorted_rtt, 0.75)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment