You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2010/03/12 00:30:34 UTC
svn commit: r922067 -
/jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java
Author: sebb
Date: Thu Mar 11 23:30:34 2010
New Revision: 922067
URL: http://svn.apache.org/viewvc?rev=922067&view=rev
Log:
Fix up values map for aggregate samples
Modified:
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java
Modified: jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java?rev=922067&r1=922066&r2=922067&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java (original)
+++ jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/math/StatCalculator.java Thu Mar 11 23:30:34 2010
@@ -194,7 +194,6 @@ public abstract class StatCalculator<T e
protected abstract T divide(T val, int n);
public void addValue(T val, int sampleCount) {
- updateValueCount(val, sampleCount);
count += sampleCount;
double currentVal = val.doubleValue();
sum += currentVal;
@@ -208,6 +207,7 @@ public abstract class StatCalculator<T e
sumOfSquares += currentVal * currentVal;
actualValue = val;
}
+ updateValueCount(actualValue, sampleCount);
mean = sum / count;
deviation = Math.sqrt((sumOfSquares / count) - (mean * mean));
if (actualValue.compareTo(max) > 0){
@@ -222,13 +222,13 @@ public abstract class StatCalculator<T e
addValue(val,1);
}
- private void updateValueCount(T val, int sampleCount) {
- MutableLong count = valuesMap.get(val);
+ private void updateValueCount(T actualValue, int sampleCount) {
+ MutableLong count = valuesMap.get(actualValue);
if (count != null) {
count.add(sampleCount);
} else {
// insert new value
- valuesMap.put(val, new MutableLong(sampleCount));
+ valuesMap.put(actualValue, new MutableLong(sampleCount));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org