Commit ec8d291c authored by Arnaud Fontaine's avatar Arnaud Fontaine

Add string representation of a benchmark result.

parent 89aee418
......@@ -104,17 +104,10 @@ class BenchmarkProcess(multiprocessing.Process):
else:
for stat in result.getCurrentSuiteStatList():
mean = stat.mean
self._logger.info("%s: min=%.3f, mean=%.3f (+/- %.3f), max=%.3f" % \
(stat.full_label,
stat.minimum,
mean,
stat.standard_deviation,
stat.maximum))
self._logger.info(str(stat))
if (self._argument_namespace.max_global_average and
mean > self._argument_namespace.max_global_average):
stat.mean > self._argument_namespace.max_global_average):
raise RuntimeError("Stopping as mean is greater than maximum "
"global average")
......
......@@ -53,6 +53,14 @@ class BenchmarkResultStatistic(object):
self._variance_sum = 0
self._mean = 0
def __str__(self):
return "%s: min=%.3f, mean=%.3f (+/- %.3f), max=%.3f" % \
(self.full_label,
self.minimum,
self.mean,
self.standard_deviation,
self.maximum)
def add(self, value):
if value < 0:
self.error_sum += 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment