From 26cb37c5a21427ff1e13c9d05b8a1c1767568a1b Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Mon, 21 Nov 2016 10:55:23 +0100 Subject: [PATCH] Added support for multiple analysis files. --- analysis.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/analysis.py b/analysis.py index 6c0b20e..a98e334 100755 --- a/analysis.py +++ b/analysis.py @@ -12,6 +12,7 @@ def calc_utilization(tasks): def main(): parser = argparse.ArgumentParser(description='Generate plotable results from the experiments.') parser.add_argument('results', type=str, nargs='+', help='file containing experiment results.') + parser.add_argument('analysis', type=str, nargs='+', help='name identifying the analysis results.') args = parser.parse_args() @@ -85,27 +86,27 @@ def main(): except KeyError: out[outkey] = [(s2s, e2e, misses, response)] - with open('analysis/s2s.dat', 'w') as s2sfile: + with open('analysis/{}_s2s.dat'.format(args.analysis), 'w') as s2sfile: for key, value in out.items(): for elem in value: print('{}; {}'.format(key, elem[0]), file=s2sfile) - with open('analysis/e2e.dat', 'w') as e2efile: + with open('analysis/{}_e2e.dat'.format(args.analysis), 'w') as e2efile: for key, value in out.items(): for elem in value: print('{}; {}'.format(key, elem[1]), file=e2efile) - with open('analysis/misses.dat', 'w') as missesfile: + with open('analysis/{}_misses.dat'.format(args.analysis), 'w') as missesfile: for key, value in out.items(): for elem in value: print('{}; {}'.format(key, elem[2]), file=missesfile) - with open('analysis/misses_avrg.dat', 'w') as missesavrgfile: + with open('analysis/{}_misses_avrg.dat'.format(args.analysis), 'w') as missesavrgfile: for key, value in out.items(): for elem in value: print('{}; {}'.format(key, elem[3]), file=missesavrgfile) - with open('analysis/response.dat', 'w') as responsefile: + with open('analysis/{}_response.dat'.format(args.analysis), 'w') as responsefile: for key, value in out.items(): for elem in value: print('{}; {}'.format(key, elem[3]), file=responsefile) -- libgit2 0.26.0