summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-24 16:07:50 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-04-24 16:07:50 -0300
commit908c95ba858a2031903960961b3c21dfcce2968e (patch)
tree23e4bd56e057429b0019cd4f5f579cda4c972cc7
parenta873c115e0db45283ae15891de9ba8c203521ab4 (diff)
Add a column with average value of input files.devs/lauromoura/reporting
Gather the averages of the non-reference files.
-rwxr-xr-xsrc/bin/expedite-cmp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/expedite-cmp b/src/bin/expedite-cmp
index 2df42c8..16ba680 100755
--- a/src/bin/expedite-cmp
+++ b/src/bin/expedite-cmp
@@ -7,6 +7,7 @@ import os
7import os.path 7import os.path
8import csv 8import csv
9from optparse import OptionParser 9from optparse import OptionParser
10from collections import defaultdict
10 11
11fmttext = '%(value)7.2f (%(percentual)+6.1f%%)' 12fmttext = '%(value)7.2f (%(percentual)+6.1f%%)'
12fmthtml = '%(value)7.2f <span style="color: #666; width: 55pt; display: inline-block; text-align: right; text-shadow: #999 1px 1px 3px;">(%(percentual)+0.1f%%)</span>' 13fmthtml = '%(value)7.2f <span style="color: #666; width: 55pt; display: inline-block; text-align: right; text-shadow: #999 1px 1px 3px;">(%(percentual)+0.1f%%)</span>'
@@ -64,6 +65,17 @@ for f in files:
64 d[t] = float(row[0]) 65 d[t] = float(row[0])
65 max_test_name = max(len(t), max_test_name) 66 max_test_name = max(len(t), max_test_name)
66 67
68# Insert averages
69data['average'] = defaultdict(list)
70for f in others_f:
71 for test in data[f]:
72 data['average'][test].append(data[f][test])
73for test in data['average']:
74 values = data['average'][test]
75 data['average'][test] = sum(values)/len(values)
76
77others_f.insert(0, 'average')
78
67def report_text(): 79def report_text():
68 test_name_fmt = "%%%ds:" % max_test_name 80 test_name_fmt = "%%%ds:" % max_test_name
69 81
@@ -126,6 +138,7 @@ def report_html():
126 import time 138 import time
127 139
128 fnames = [os.path.basename(f) for f in files] 140 fnames = [os.path.basename(f) for f in files]
141 fnames.insert(1, 'Average')
129 print("""\ 142 print("""\
130<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 143<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
131 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 144 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">