From 01cf6ef60920c50df0de789f122a8f0a8b238fa2 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 15 Apr 2013 16:44:51 +0200 Subject: cyclictest: Don't bother reporting 'variance' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- rteval/modules/measurement/cyclictest.py | 12 ++---------- rteval/rteval_text.xsl | 5 ----- server/parser/xmlparser.xsl | 2 -- 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 @@ - Variance: - - - - Std.dev: 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 @@ median stddev mean_abs_dev - variance @@ -483,7 +482,6 @@ - -- cgit