[libvirt-test-api][PATCH 2/3] improve the way we get the standard deviation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
 utils/utils.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/utils/utils.py b/utils/utils.py
index 954b2bf..a6e6965 100644
--- a/utils/utils.py
+++ b/utils/utils.py
@@ -906,9 +906,10 @@ def get_standard_deviation(cb1, cb2, opaque1, opaque2, number = 1000):
     """
     D = 0
     for i in range(number):
-        a = cb1(opaque1)
+        a1 = cb1(opaque1)
         b = cb2(opaque2)
-        D += (int(a) - int(b))**2
+        a2 = cb1(opaque1)
+        D += ((int(a1) + int(a2))/2 - int(b))**2
     return math.sqrt(D/number)
 
 def param_to_tuple_nolength(paramlist):
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]