Patch
This commit is contained in:
parent
e392cded61
commit
bfe035a851
2 changed files with 10 additions and 8 deletions
|
@ -690,7 +690,7 @@ jan_tor_analysis:
|
|||
|
||||
jan_battle_normal:
|
||||
./run-3 \
|
||||
8,battle. \
|
||||
8,jan_battle_normal. \
|
||||
orig-client 135000 40 172, \
|
||||
orig-client 135000 40 172, \
|
||||
orig-client 135000 40 172, \
|
||||
|
|
|
@ -10,7 +10,7 @@ def tool_distri(arr, perc):
|
|||
return r
|
||||
|
||||
def compute_failure(s):
|
||||
it = s['current']['strat']
|
||||
it = (s['current']['strat'], s['current']['mode'])
|
||||
if it not in s['failure']: s['failure'][it] = []
|
||||
s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60))
|
||||
return True
|
||||
|
@ -35,8 +35,9 @@ def extract_info(inf, s):
|
|||
try:
|
||||
with open(inf) as f:
|
||||
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
|
||||
s['current']['mode'] = w.groups()[0]
|
||||
x = re.search(r'server= (\S+) (\d+) (\d+) \d+ (\d+ (\S+))?', full)
|
||||
if x:
|
||||
s['current']['strat'] = x.groups()[0]
|
||||
|
@ -60,7 +61,7 @@ def extract_folder(p, s):
|
|||
def categorize(folder, s):
|
||||
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] = []
|
||||
s['per_strat'][i].append(s['current'])
|
||||
|
||||
|
@ -80,17 +81,18 @@ def extract(p, s):
|
|||
def analyze_failure(s):
|
||||
with open('jan2_failure.csv', 'w') as f:
|
||||
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)
|
||||
total = len(v)
|
||||
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):
|
||||
if e >= 90:
|
||||
f.write(f"{strat},90,{score}\n")
|
||||
f.write(f"{mode},{strat},90,{score}\n")
|
||||
break
|
||||
score = idx/total
|
||||
f.write(f"{strat},{e},{score}\n")
|
||||
f.write(f"{mode},{strat},{e},{score}\n")
|
||||
|
||||
def analyze(s):
|
||||
print("analyzing...")
|
||||
|
|
Loading…
Reference in a new issue