From 29104c1a8213845957aad3c536582e944de0e85c Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 12 Nov 2015 11:45:53 +0100 Subject: Parse benchmark output --- tools/parsebench.py | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 tools/parsebench.py (limited to 'tools/parsebench.py') diff --git a/tools/parsebench.py b/tools/parsebench.py new file mode 100755 index 0000000..acf018a --- /dev/null +++ b/tools/parsebench.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +# Copyright (c) 2014, NORDUnet A/S. +# See LICENSE for licensing information. + +import argparse +import sys +import ast +import itertools + +def parse_one_line(line): + row = line.rstrip().split(":") + assert row[0].startswith("mergeoutput.") + iteration = int(row[0][12:]) + stage = row[2].strip() + data = ast.literal_eval(row[3].strip()) + return (iteration, stage, data) + +def main(): + parser = argparse.ArgumentParser(description="") + parser.add_argument('inputfile', help="Input file") + args = parser.parse_args() + lines = [parse_one_line(line) for line in open(args.inputfile)] + iterations = itertools.groupby(lines, lambda x: x[0]) + print "" + print "" + print "" + print "" + print "" + print "
" + legend = [] + for (i, iteration) in iterations: + print "" + for (stagen, (_, stage, data)) in enumerate(iteration): + if i == 0: + legend.append("
%s" % (stage,)) + data = list(data) + for (itemn, (item, useconds)) in enumerate(data): + seconds = useconds / 1000000 + step = 50 / (len(data) - 1) + print "
" + if i == 0: + legend.append("") + print "
" % (seconds, stagen * 90, itemn * step + 40, stage, item) + if i == 0: + legend.append("%s" % (stagen * 90, itemn * step + 40, item)) + print " " + print "
" + print "
" + print "
" + print "
" + print "
" + for row in legend: + print row + print "
" + print "" + print "" + +main() -- cgit v1.1