Friday, January 20, 2012

JMeter Calculation

3 comments:


Throughput Calculation In JMeter

  1. select a label name in result.xml which is generated by jmeter
  2. search the min (timestamp(ts)) for corresponding labels
  3. search the max (timestamp (ts)  + elapsed time (t)) for  corresponding labels.
  4. calculate the difference between max and min 
  5. calculate Throughput= (number of samples/ difference between max and min) * 1000  



  1. select a label name(Register) in result.xml which is generated by jmeter
  2. search the min (timestamp(ts)) 1327038233281 in result.xml
  3. search the max (timestamp (ts)  + elapsed time (t)) 1327038233781 + 47.
  4. calculate the difference between max and min (1327038233828 -  1327038233281  )..  Diff ===> 547
  5. calculate Throughput= (number of samples/ difference between max and min) * 1000 (2/547) ... Result is.. 3.656307129798903107861060329067
  6. Round the Final throughput value.
ThroughPut  = (No of sample / (max(ts + t) - min(ts)) )
Standard Deviation Calculation in JMeter

standard devaiation(SD) =
x = particular label's t(Time)
x_(x bar) = some of all time(T) of specific label / no of samples

No of samples specifies = number of occurrence of a label in xml file(No of hits of a label)

KB/SEC Calculation in JMeter

kb/sec = (avg bytes /1024) * through put

Avg bytes = avg bytes of specific label bytes (by).

Total Calculation in JMeter

When calculating total row values for jmeter we should not consider labels. Instead of that we have consider the whole xml file as data and we have to use the above formula to calculate it. Don't consider labels. In whole xml take max ts value and min ts and proceed and no of samples
(Total occurrence of all labels). for throughput.


For Standard deviation don't consider labels. Take whole xml.

xBar(x_) = sumOfTime(t) / totalNoOfSamples;
for (Integer time(t) : allTimes) {
    // for each time we have to find this value
    sumOfMean += Math.pow(time(t) - xBar(x_), 2);
}


Final calculation : 

 sqrt(sumOfMean / getNoOfSamples());

For KB/SEC calculation  , don't consider labels , take all by values in xml file.

For Total row calculation formula is same but the only difference is , don't consider labels. Otherwise same.

Happy Coding :).

--
Thanks.
Chelladurai.

Regards,
Kaleeswaran.S

Read More