summaryrefslogtreecommitdiff
path: root/tools/parsebench.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-11-02 12:55:20 +0100
committerMagnus Ahltorp <map@kth.se>2016-11-02 12:55:20 +0100
commit6659a1c08dda0d6ec20f945e135b23b544db55a4 (patch)
treeb2ed171fc9976889c1b4b4bbe7ab1dcfd7815e02 /tools/parsebench.py
parentb4dc2c37be0ed51b629e91f4d3e1dfc44cb192c0 (diff)
Added performance testslarge-tests5
Diffstat (limited to 'tools/parsebench.py')
-rwxr-xr-xtools/parsebench.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/parsebench.py b/tools/parsebench.py
index 96c36d6..671e482 100755
--- a/tools/parsebench.py
+++ b/tools/parsebench.py
@@ -10,8 +10,8 @@ import itertools
def parse_one_line(line):
row = line.rstrip().split(":")
- assert row[0].startswith("mergeoutput.")
- iteration = int(row[0][12:])
+ assert row[0].startswith("bench-")
+ iteration = int(row[0][6:])
stage = row[2].strip()
data = ast.literal_eval(row[3].strip())
return (iteration, stage, data)
@@ -30,29 +30,34 @@ def main():
print "</body>"
print "</html>"
+scale = 0.25
+
def parse_one_file(filename):
lines = [parse_one_line(line) for line in open(filename)]
iterations = itertools.groupby(lines, lambda x: x[0])
print "<h1>%s</h1>" % (filename,)
print "<div>"
legend = []
+ firsttime = True
for (i, iteration) in iterations:
- print "<table><tr>"
+ print >>sys.stderr, (i, iteration)
+ print "<table style='border-collapse: collapse;'><tr>"
for (stagen, (_, stage, data)) in enumerate(iteration):
- if i == 0:
+ if firsttime:
legend.append("<div><span>%s</span>" % (stage,))
data = list(data)
for (itemn, (item, useconds)) in enumerate(data):
seconds = useconds / 1000000
step = 50 / (len(data) - 1)
- print "<td style='width: %dpx; padding: 0; background-color: hsl(%d, 90%%, %d%%);' title='%s:%s %d'>" % (seconds/4, stagen * 90, itemn * step + 40, stage, item, seconds)
- if i == 0:
+ print "<td style='width: %dpx; padding: 0; background-color: hsl(%d, 90%%, %d%%);' title='%s:%s %d'>" % (int(seconds*scale), stagen * 90, itemn * step + 40, stage, item, seconds)
+ if firsttime:
legend.append("<span style='background-color: hsl(%d, 90%%, %d%%);'>%s</span>" % (stagen * 90, itemn * step + 40, item))
print "&nbsp;"
print "</td>"
- if i == 0:
+ if firsttime:
legend.append("</div>")
print "</tr></table>"
+ firsttime = False
print "</div>"
print "<div style='height: 30px;'>"
print "</div>"