WIP dcallan

This commit is contained in:
Quentin 2020-02-05 09:12:21 +01:00
parent 8d23941c9a
commit ef17ac5728

13
scripts/dcallan.py Normal file → Executable file
View file

@ -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)