Commit 908c67a3 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Add error properly rather than assuming that a value equals to 0 is an error


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@46010 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3e12b87c
...@@ -138,11 +138,10 @@ class BenchmarkResultStatistic(object): ...@@ -138,11 +138,10 @@ class BenchmarkResultStatistic(object):
self._variance_sum = 0 self._variance_sum = 0
self._mean = 0 self._mean = 0
def add(self, value): def add_error(self):
if value == 0: self.error_sum += 1
self.error_sum += 1
return
def add(self, value):
if value < self.minimum: if value < self.minimum:
self.minimum = value self.minimum = value
if value > self.maximum: if value > self.maximum:
...@@ -239,7 +238,7 @@ class BenchmarkResult(object): ...@@ -239,7 +238,7 @@ class BenchmarkResult(object):
expected_result_idx = self._result_idx_checkpoint_list[self._suite_idx] expected_result_idx = self._result_idx_checkpoint_list[self._suite_idx]
while self._result_idx != expected_result_idx: while self._result_idx != expected_result_idx:
self.result_list.append(0) self.result_list.append(0)
self._stat_list[self._result_idx].add(0) self._stat_list[self._result_idx].add_error()
self._result_idx += 1 self._result_idx += 1
self._suite_idx += 1 self._suite_idx += 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