Generate all files I want

This commit is contained in:
Quentin Dufour 2020-01-16 18:29:24 +00:00
parent 3a6a9055d3
commit 11472da493

View file

@ -16,7 +16,7 @@ def compute_failure(s):
def compute_circuit_distri(s):
l = sorted(s['current']['lats'])
s['current']['distri'] = tool_distri(l, default_perc)
s['per_circuit_res'].append(tool_distri(l, default_perc))
def compute_interval_distri(s):
print(" + latency distribution for given packet freq.")
@ -104,12 +104,28 @@ def analyze_interval(s):
for perc, lat in entr.items():
f.write(f"{rate},{perc},{lat}\n")
def analyze_circuit(s):
a = sorted(s['per_circuit_res'], key=lambda v: v['0.5'])
with open('jan_circuit_median.csv', 'w') as f:
f.write(f"id,perc,lat\n")
for idx,e in enumerate(a,start=1):
for perc, lat in e.items():
f.write(f"{idx},{perc},{lat}\n")
a = sorted(s['per_circuit_res'], key=lambda v: v['1'])
with open('jan_circuit_max.csv', 'w') as f:
f.write(f"id,perc,lat\n")
for idx,e in enumerate(a,start=1):
for perc, lat in e.items():
f.write(f"{idx},{perc},{lat}\n")
def analyze(s):
print("analyzing...")
analyze_failure(s)
analyze_interval(s)
analyze_circuit(s)
state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}}
state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}, 'per_circuit_res': []}
extract(sys.argv[1], state)
compute_global(state)
analyze(state)