Generate all files I want
This commit is contained in:
parent
3a6a9055d3
commit
11472da493
1 changed files with 18 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue