summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--rteval/modules/measurement/cyclictest.py12
-rw-r--r--rteval/rteval_text.xsl5
-rw-r--r--server/parser/xmlparser.xsl2
3 files changed, 2 insertions, 17 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')
diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl
index 615ddaf..2613189 100644
--- a/rteval/rteval_text.xsl
+++ b/rteval/rteval_text.xsl
@@ -274,11 +274,6 @@
<xsl:value-of select="mean_absolute_deviation/@unit"/>
<xsl:text>&#10;</xsl:text>
- <xsl:text> Variance: </xsl:text>
- <xsl:value-of select="variance"/>
- <xsl:value-of select="variance/@unit"/>
- <xsl:text>&#10;</xsl:text>
-
<xsl:text> Std.dev: </xsl:text>
<xsl:value-of select="standard_deviation"/>
<xsl:value-of select="standard_deviation/@unit"/>
diff --git a/server/parser/xmlparser.xsl b/server/parser/xmlparser.xsl
index e8f61a0..6044967 100644
--- a/server/parser/xmlparser.xsl
+++ b/server/parser/xmlparser.xsl
@@ -460,7 +460,6 @@
<field fid="9">median</field>
<field fid="10">stddev</field>
<field fid="11">mean_abs_dev</field>
- <field fid="12">variance</field>
</fields>
<records>
<xsl:for-each select="core/statistics[samples > 0]|system/statistics[samples > 0]">
@@ -483,7 +482,6 @@
<value fid="9"><xsl:value-of select="mean"/></value>
<value fid="10"><xsl:value-of select="standard_deviation"/></value>
<value fid="11"><xsl:value-of select="mean_absolute_deviation"/></value>
- <value fid="12"><xsl:value-of select="variance"/></value>
</record>
</xsl:for-each>
</records>