fix bugs
This commit is contained in:
parent
aa32e6d1fe
commit
3a6a9055d3
1 changed files with 12 additions and 2 deletions
|
@ -25,6 +25,7 @@ def compute_interval_distri(s):
|
|||
for inter, val in s['per_interval'].items():
|
||||
progress = round(processed / to_process * 100)
|
||||
print(f"{progress}%", end="\r")
|
||||
#print(val[0]['lats'][0:10])
|
||||
x = sorted(functools.reduce(lambda acc, v: acc + v['lats'], val, []))
|
||||
s['per_interval_res'][inter] = tool_distri(x, default_perc)
|
||||
processed += 1
|
||||
|
@ -36,8 +37,9 @@ def extract_measlat(log, s):
|
|||
for l in f:
|
||||
x = re.search(r'Packet (\d+) latency (\d+)µs with', l)
|
||||
if x:
|
||||
lat = x.groups()[0]
|
||||
s['current']['max_pkt'] = max(s['current']['max_pkt'], int(lat))
|
||||
pkt = int(x.groups()[0])
|
||||
lat = int(x.groups()[1])
|
||||
s['current']['max_pkt'] = max(s['current']['max_pkt'], pkt)
|
||||
s['current']['lats'].append(lat)
|
||||
|
||||
def extract_info(inf, s):
|
||||
|
@ -95,9 +97,17 @@ def analyze_failure(s):
|
|||
score = idx/total
|
||||
f.write(f"{rate},{e},{score}\n")
|
||||
|
||||
def analyze_interval(s):
|
||||
with open('jan_interval.csv', 'w') as f:
|
||||
f.write(f"rate,perc,lat\n")
|
||||
for rate, entr in s['per_interval_res'].items():
|
||||
for perc, lat in entr.items():
|
||||
f.write(f"{rate},{perc},{lat}\n")
|
||||
|
||||
def analyze(s):
|
||||
print("analyzing...")
|
||||
analyze_failure(s)
|
||||
analyze_interval(s)
|
||||
|
||||
state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}}
|
||||
extract(sys.argv[1], state)
|
||||
|
|
Loading…
Reference in a new issue