summaryrefslogtreecommitdiffstats
path: root/rteval/modules/measurement/cyclictest.py
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2013-04-15 16:44:51 +0200
committerDavid Sommerseth <davids@redhat.com>2013-04-15 16:57:51 +0200
commit01cf6ef60920c50df0de789f122a8f0a8b238fa2 (patch)
treeb94d535df50cb4b0603682990297a6113ea93c9f /rteval/modules/measurement/cyclictest.py
parent5c654b7828c99af30f68de08d45a2e09dd43de75 (diff)
downloadrteval-01cf6ef60920c50df0de789f122a8f0a8b238fa2.tar.gz
rteval-01cf6ef60920c50df0de789f122a8f0a8b238fa2.tar.xz
rteval-01cf6ef60920c50df0de789f122a8f0a8b238fa2.zip
cyclictest: Don't bother reporting 'variance'
The data used to do the mathematical reporting is based on histogram data, where the calculated variance will be rather pointless to gather. Imagine you have 3 samples in the historgram in the 2000µs slot, even if you have quite a lot of data with the average measurements around 50µs, the calculated "variance" for that time slot will be (1950^2)*3. Even though the final variance calculation will divide on number of samples gathered, it will take an enormous amount of samples within a the lower time slots to make this value interesting. So rather, don't report or save the calculated variance. However, the standard deviation is based on the variance, that value is far more sane due to the needed square root function on the final variance value. So it gives a far more sane and interesting value. The applied math in the cyclictest module should be fine itself, it's just the variance value that isn't much interesting on this kind of data source. Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'rteval/modules/measurement/cyclictest.py')
-rw-r--r--rteval/modules/measurement/cyclictest.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
index 4d946e3..1d6acdc 100644
--- a/rteval/modules/measurement/cyclictest.py
+++ b/rteval/modules/measurement/cyclictest.py
@@ -48,7 +48,6 @@ class RunData(object):
self.__median = 0.0
self.__range = 0.0
self.__mad = 0.0
- self.__variance = 0.0
self._log = logfnc
def sample(self, value):
@@ -71,7 +70,6 @@ class RunData(object):
# to zero and return
if self.__numsamples <= 1:
self._log(Log.DEBUG, "skipping %s (%d samples)" % (self.__id, self.__numsamples))
- self.__variance = 0
self.__mad = 0
self.__stddev = 0
return
@@ -109,17 +107,14 @@ class RunData(object):
high -= 1
self.__range = high - low
- # Mean Absolute Deviation and Variance
+ # Mean Absolute Deviation and standard deviation
madsum = 0
varsum = 0
for i in keys:
madsum += float(abs(float(i) - self.__mean) * self.__samples[i])
varsum += float(((float(i) - self.__mean) ** 2) * self.__samples[i])
self.__mad = madsum / self.__numsamples
- self.__variance = varsum / (self.__numsamples - 1)
-
- # standard deviation
- self.__stddev = math.sqrt(self.__variance)
+ self.__stddev = math.sqrt(varsum / (self.__numsamples - 1))
def MakeReport(self):
@@ -156,9 +151,6 @@ class RunData(object):
n = stat_n.newTextChild(None, 'mean_absolute_deviation', str(self.__mad))
n.newProp('unit', 'us')
- n = stat_n.newTextChild(None, 'variance', str(self.__variance))
- n.newProp('unit', 'us')
-
n = stat_n.newTextChild(None, 'standard_deviation', str(self.__stddev))
n.newProp('unit', 'us')