Thanks, looks good. I've applied it and will commit soon. -Mike
On 5 Feb 2003 at 15:43, Jeremy Arnold wrote: > Hello, > I've evaluated using JMeter a couple of times in the past, but haven't > actually used it for any real work until now. I've encountered (and > fixed) a couple of bugs. Here's the first one -- I'll try to get the > others cleaned up and posted in the next few days. I haven't > contributed to Apache projects before, so please let me know if I need > to do something differently in the future. > > The calculation of the standard deviation in > org.apache.jmeter.visualizers.GraphModel is incorrect. It maintains a > running sum of the square of the difference between the sample value and > the average, and then uses this to calculate the deviation. This is > incorrect, since the average at the time this sample is added is not the > same as the average when the next sample is added. > > Here's an example to illustrate the problem. Let's assume we have 5 > data points: 20, 80, 40, 100, 120. Here is what JMeter will calculate > at each point: > > # Value Average Deviation Correct Deviation > 1: 20 20 0 0 > 2: 80 50 21 21 > 3: 40 47 18 25 > 4: 100 60 25 32 > 5: 120 72 31 37 > > The correct way to calculate the standard deviation as values are added > is to keep a running sum of the samples and the sum of the squares. > Then the variance is the mean of the squares minus the square of the > mean, and the standard deviation is the square root of the variance. > > The attached patch should calculate the standard deviation correctly. > > Jeremy > -- Michael Stover [EMAIL PROTECTED] Yahoo IM: mstover_ya ICQ: 152975688 AIM: mstover777 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
