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

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




On 05/18/2015 09:28 AM, Luyao Huang wrote:
Signed-off-by: Luyao Huang <lhuang redhat com>
---
  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)
ACK, this will spend a double time, whatever, we need a more accurate return.
  def param_to_tuple_nolength(paramlist):


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