tor_multipath_voip/scripts/boxplot.py
Quentin Dufour 6c8d7be706 Fix typo
2019-11-01 17:15:04 +00:00

36 lines
1.2 KiB
Python
Executable file

#!/usr/bin/python3
import sys, re
current_run="none"
d = {}
input()
for line in sys.stdin:
packet_id,latency,flag,link_id,vanilla,way,run,conf = line.split(",")
conf = conf.rstrip()
if int(packet_id) > 7400 or int(packet_id) < 10: continue
latency = int(latency)
if conf not in d: d[conf] = {}
if (run,way,packet_id) not in d[conf]:
d[conf][(run,way,packet_id)] = latency
else:
d[conf][(run,way,packet_id)] = min(latency, d[conf][(run,way,packet_id)])
#print("strat,window,decile,latency")
print("fast_count,strat,decile,latency")
for conf,value in d.items():
s = sorted(value.values())
szs = len(s)
#m = re.match(r".*tick_tock=(\d+).+window=(\d+)", conf)
m = re.match(r".*fast_count=(\d+)!tick_tock=(\d+)", conf)
#m = re.match(r"^(\d+).*tick_tock=(\d+)", conf)
print(f"{m[1]},{m[2]},MIN,{s[0]}")
print(f"{m[1]},{m[2]},D0.1,{s[int(szs*0.001)]}")
print(f"{m[1]},{m[2]},D1,{s[int(szs*0.01)]}")
print(f"{m[1]},{m[2]},D25,{s[int(szs*0.25)]}")
print(f"{m[1]},{m[2]},D50,{s[int(szs*0.5)]}")
print(f"{m[1]},{m[2]},D75,{s[int(szs*0.75)]}")
print(f"{m[1]},{m[2]},D99,{s[int(szs*0.99)]}")
print(f"{m[1]},{m[2]},D99.9,{s[int(szs*0.999)]}")
print(f"{m[1]},{m[2]},MAX,{s[-1]}")