added standard deviation check in time based tests

This commit is contained in:
Miroslav Stampar
2010-12-07 16:39:31 +00:00
parent 294119d2ec
commit ecd4a5a532
4 changed files with 48 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ from ConfigParser import RawConfigParser
from StringIO import StringIO
from difflib import SequenceMatcher
from inspect import getmembers
from math import sqrt
from subprocess import PIPE
from subprocess import Popen as execute
from tempfile import NamedTemporaryFile
@@ -1276,6 +1277,18 @@ def readXmlFile(xmlFile):
xfile.close()
return retVal
def stdev(values):
"""
Computes standard deviation of a list of numbers.
"""
sum = 0.0
avg = average(values)
for value in values:
sum += pow(value - avg, 2)
return sqrt(sum/len(values))
def average(values):
"""
Computes the arithmetic mean of a list of numbers.