diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 1c27e16..529d3ad 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -41,11 +41,15 @@ def extract(p, s): print("done") def analyze_failure(s): - print(f"rate,duration") - for k, v in s['failure'].items(): - rate = round(1000 / k) - for e in v: - print(f"{rate},{e}") + with open('jan_failure.csv', 'w') as f: + f.write(f"rate,duration,ecdf\n") + for k, v in s['failure'].items(): + v = sorted(v) + total = len(v) + rate = round(1000 / k) + for idx,e in enumerate(v,start=1): + if e == 90: break + f.write(f"{rate},{e},{idx/total}\n") def analyze(s): print("analyzing...")