diff --git a/results/analyze.py b/results/analyze.py index 507611ca602acf5d4b16749f90cbc35cd54d1326..023237578bbafcea369707d6ee2bf577d65ceda8 100644 --- a/results/analyze.py +++ b/results/analyze.py @@ -23,15 +23,17 @@ for fname in all_logs: bad_pings=0 good_pings=0 avg_time=0 + max_ping_time=0 + consecutive_bad=0 # consider consecutive_bad_max as power down indicator - consecutive_bad_max=60 + consecutive_bad_max=6 for i, line in enumerate(open(fname)): #print(i,line) - lastline=line -# cut off the beginning because there were double ping processes writing to same file + +# cut off the beginning because (on meshgate) there were double ping processes writing to same file if i<3500: continue @@ -56,13 +58,17 @@ for fname in all_logs: if line.find("time=")<0: bad_pings+=1 consecutive_bad+=1 - print(line) + #print(line) else: good_pings+=1 consecutive_bad=0 t_ms=re.findall(r"time=\w+.\w+ ms",line) - avg_time=(avg_time+float(t_ms[0][5:-2]))/2 + tms=float(t_ms[0][5:-2]) + + max_ping_time=max(max_ping_time,tms) + + avg_time=(avg_time+tms)/2 if consecutive_bad>consecutive_bad_max: break @@ -77,4 +83,6 @@ for fname in all_logs: print("last: line",i,dt_end,"seconds: ",tsdiff, "hours: ", tsdiff/3600) print("bad pings: ",bad_pings, "(",round(bad_pings/(tsdiff/100)),"%)") print("average ping time: ",avg_time) + print("max ping time: ",max_ping_time) + print("___________________________________________________________") \ No newline at end of file