From: Ondrej Lichtner <olichtne(a)redhat.com>
The standard deviation of a single interval measurement is 0 since it's
the smallest measurement precision we have.
This also adds a __str__ method to pretty print the PerfInterval
objects.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/RecipeCommon/PerfResult.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/RecipeCommon/PerfResult.py b/lnst/RecipeCommon/PerfResult.py
index 9afac16..f48fd0a 100644
--- a/lnst/RecipeCommon/PerfResult.py
+++ b/lnst/RecipeCommon/PerfResult.py
@@ -28,6 +28,14 @@ class PerfInterval(PerfStatMixin):
def unit(self):
return self._unit
+ @property
+ def std_deviation(self):
+ return 0
+
+ def __str__(self):
+ return "{} {} in {} seconds".format(
+ self.value, self.unit, self.duration)
+
class PerfList(list):
_sub_type = None
--
2.19.0