This commit is contained in:
Quentin Dufour 2020-01-23 20:43:55 +00:00
parent e392cded61
commit bfe035a851
2 changed files with 10 additions and 8 deletions

View file

@ -690,7 +690,7 @@ jan_tor_analysis:
jan_battle_normal: jan_battle_normal:
./run-3 \ ./run-3 \
8,battle. \ 8,jan_battle_normal. \
orig-client 135000 40 172, \ orig-client 135000 40 172, \
orig-client 135000 40 172, \ orig-client 135000 40 172, \
orig-client 135000 40 172, \ orig-client 135000 40 172, \

View file

@ -10,7 +10,7 @@ def tool_distri(arr, perc):
return r return r
def compute_failure(s): def compute_failure(s):
it = s['current']['strat'] it = (s['current']['strat'], s['current']['mode'])
if it not in s['failure']: s['failure'][it] = [] if it not in s['failure']: s['failure'][it] = []
s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60)) s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60))
return True return True
@ -35,8 +35,9 @@ def extract_info(inf, s):
try: try:
with open(inf) as f: with open(inf) as f:
full = ''.join(f.readlines()) full = ''.join(f.readlines())
w = re.search(r'identifier=jan_', full) w = re.search(r'identifier=jan_battle_(\w+)', full)
if not w: return False if not w: return False
s['current']['mode'] = w.groups()[0]
x = re.search(r'server= (\S+) (\d+) (\d+) \d+ (\d+ (\S+))?', full) x = re.search(r'server= (\S+) (\d+) (\d+) \d+ (\d+ (\S+))?', full)
if x: if x:
s['current']['strat'] = x.groups()[0] s['current']['strat'] = x.groups()[0]
@ -60,7 +61,7 @@ def extract_folder(p, s):
def categorize(folder, s): def categorize(folder, s):
s[folder] = s['current'] s[folder] = s['current']
i = str(s['current']['strat']) i = (s['current']['strat'], s['current']['mode'])
if i not in s['per_strat']: s['per_strat'][i] = [] if i not in s['per_strat']: s['per_strat'][i] = []
s['per_strat'][i].append(s['current']) s['per_strat'][i].append(s['current'])
@ -80,17 +81,18 @@ def extract(p, s):
def analyze_failure(s): def analyze_failure(s):
with open('jan2_failure.csv', 'w') as f: with open('jan2_failure.csv', 'w') as f:
f.write(f"strat,duration,ecdf\n") f.write(f"strat,duration,ecdf\n")
for strat, v in s['failure'].items(): for k, v in s['failure'].items():
strat, mode = k
v = sorted(v) v = sorted(v)
total = len(v) total = len(v)
score = 0 score = 0
f.write(f"{strat},0,0\n") f.write(f"{mode},{strat},0,0\n")
for idx,e in enumerate(v,start=1): for idx,e in enumerate(v,start=1):
if e >= 90: if e >= 90:
f.write(f"{strat},90,{score}\n") f.write(f"{mode},{strat},90,{score}\n")
break break
score = idx/total score = idx/total
f.write(f"{strat},{e},{score}\n") f.write(f"{mode},{strat},{e},{score}\n")
def analyze(s): def analyze(s):
print("analyzing...") print("analyzing...")