WIP dcallan
This commit is contained in:
parent
8d23941c9a
commit
ef17ac5728
1 changed files with 10 additions and 3 deletions
13
scripts/dcallan.py
Normal file → Executable file
13
scripts/dcallan.py
Normal file → Executable 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue