diff --git a/scripts/dcallan.py b/scripts/dcallan.py old mode 100644 new mode 100755 index 40f821b..50287b0 --- a/scripts/dcallan.py +++ b/scripts/dcallan.py @@ -48,16 +48,23 @@ def extract_dcall(f, s): s['current']['success_buf'] += 1 elif 'Using NULL buffer' in line: s['current']['failed_buf'] += 1 - print(s['current']) + #print(s['current']) return True except Exception as e: print("read error", inf, e) return False +def aggregate_failed_pct(s): + k = s['current']['strat'] + 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 + return True + def extract_folder(f, s): return \ extract_info(f + '/info.txt', s) and \ - extract_dcall(f + '/log/server-dcall-gstreamer.log', s) + extract_dcall(f + '/log/server-dcall-gstreamer.log', s) and \ + aggregate_failed_pct(s) def extract(p, s): item_count = functools.reduce(lambda acc, prev: acc + 1, os.listdir(p), 0) @@ -75,7 +82,7 @@ def extract(p, s): print(f"{progress}%", end="\r") print("done") -state = {'failure': {}, 'per_strat': {}, 'per_interval_res': {}, 'per_circuit_res': []} +state = {'failed_1pct': {}} extract(sys.argv[1], state) print(state)