Commit 63497a84 authored by Roque's avatar Roque Committed by Klaus Wölfel

benchmark: control for division by zero

parent 5ff28f51
...@@ -80,10 +80,14 @@ class BenchmarkResultStatistic(object): ...@@ -80,10 +80,14 @@ class BenchmarkResultStatistic(object):
@property @property
def mean(self): def mean(self):
if self.n == 0:
self.n = 1
return self._value_sum / self.n return self._value_sum / self.n
@property @property
def standard_deviation(self): def standard_deviation(self):
if self.n == 0:
self.n = 1
return math.sqrt(self._variance_sum / self.n) return math.sqrt(self._variance_sum / self.n)
class NothingFlushedException(Exception): class NothingFlushedException(Exception):
......
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