95 def print_csv(self, outfile=sys.stdout):
96
98
99
100 outfile.write('bench,')
101 for fullconfig in self.fullconfigs:
102 outfile.write('%s,' % fullconfig.qualified_name(self.config_qualifiers))
103 outfile.write('\n')
104
105
106 for bench, row in self.rows.iteritems():
107 outfile.write('%s,' % bench)
108 for fullconfig in self.fullconfigs:
109 if fullconfig in row:
110 outfile.write('%s,' % row[fullconfig])
111 elif FLAGS.force:
112 outfile.write('NULL,')
113 else:
114 raise ValueError("%s: missing value for %s. (use --force to ignore)" %
115 (bench,
116 fullconfig.qualified_name(self.config_qualifiers)))
117 outfile.write('\n')
118
119
120 if len(self.rows) > 1:
121 outfile.write('\n')
122 self._print_computed_row('MEAN',
123 lambda col: reduce(operator.add, col.values()) /
len(col),
124 outfile=outfile)
125 self._print_computed_row('GEOMEAN',
126 lambda col: reduce(operator.mul, col.values()) ** (1.0 /
len(col)),
127 outfile=outfile)
128
def print(*args, **kwargs)