parse results

This commit is contained in:
Quentin 2020-02-05 09:37:33 +01:00
parent ef17ac5728
commit ee273f0520

View file

@ -55,15 +55,23 @@ def extract_dcall(f, s):
return False return False
def aggregate_failed_pct(s): def aggregate_failed_pct(s):
k = s['current']['strat'] k = (s['current']['strat'], s['current']['mode'])
if k not in s['failed_1pct']: s['failed_1pct'][k] = 0 if k not in s['failed_1pct']: s['failed_1pct'][k] = 0
if s['current']['success_buf'] < 16500 * 0.99: s['failed_1pct'][k] += 1 if s['current']['success_buf'] < 16500 * 0.99: s['failed_1pct'][k] += 1
if k not in s['failed_5pct']: s['failed_5pct'][k] = 0
if s['current']['success_buf'] < 16500 * 0.95: s['failed_5pct'][k] += 1
if k not in s['run_per_strat']: s['run_per_strat'][k] = 0
s['run_per_strat'][k] += 1
return True return True
def extract_folder(f, s): def extract_folder(f, s):
return \ return \
extract_info(f + '/info.txt', s) and \ extract_info(f + '/info.txt', s) and \
extract_dcall(f + '/log/server-dcall-gstreamer.log', s) and \ extract_dcall(f + '/log/client-dcall-gstreamer.log', s) and \
aggregate_failed_pct(s) aggregate_failed_pct(s)
def extract(p, s): def extract(p, s):
@ -82,7 +90,16 @@ def extract(p, s):
print(f"{progress}%", end="\r") print(f"{progress}%", end="\r")
print("done") print("done")
state = {'failed_1pct': {}} def output_res(s):
extract(sys.argv[1], state) with open('dcall_drop.csv', 'w') as f:
print(state) f.write("mode,strat,threshold,ratio\n")
for thr_name, thr_val in [('failed_1pct', 0.01), ('failed_5pct', 0.05)]:
for key,val in s[thr_name].items():
mode, strat = key
ratio = val / s['run_per_strat'][key]
f.write(f"{mode},{strat},{thr_val},{ratio}\n")
state = {'failed_1pct': {}, 'failed_5pct': {}, 'run_per_strat': {}}
extract(sys.argv[1], state)
output_res(state)