mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
added standard deviation check in time based tests
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user