2
votes

I am running the Ant task to run my JMeter script or jmx file. The script runs smooth and produces a csv file with the following (standard) information: timeStamp, elapsed, label, responseCode, threadName, success, bytes, grpThreads, allThreads, Latency, sampleCount, ErrorCount and Hostname.

My question is: how can I calculate the average response time from this CSV file? What is the formula? I know how to load the CSV file into MS-Excel but simply don't know what is the relationship among the elapsed time and latency with the average response time.

Can anyone please provide the formula with some explanations, if possible. Thank you!

--Ishti

2

2 Answers

8
votes

Average response time is a simple arithmetic mean of all elapsed (second) column values

You can ignore the Latency value, as per The Load Reports guide

LATENCY is the delay involved for your request to reach the server. The response time that is required to receive a response from the server is the sum of the response time + latency.

Given a simple test plan which executes 2 requests to http://example.com domain, result .jtl file looks as follows:

1411131392025,1002,HTTP Request,200,OK,Thread Group 1-1,text,true,1591,1002 1411131393151,187,HTTP Request,200,OK,Thread Group 1-1,text,true,1591,179

If you open this file with View Results in Table listener the output will be as below:

View Results in Table

Opening the same file in the Aggregate Report listener gives the following output:

Aggregate Report

So as you can see Average time is 594 ms. It's calculated as (1002 + 187) / 2

In Excel or equivalent you can use Average function:

Excel Average

For other fields formulae refer to JMeter's Calculator class source

3
votes

To apply the formula for Average Response Time, you should have values of individual response time first. which is not available as per your statement above.

<jmeter jmeterhome="C:\apache-jmeter-2.11"
testplan="${basedir}\tests\Loadtest.jmx"
resultlog="${basedir}\tests\LoadtestResults.jtl">
<property name="jmeter.save.saveservice.output_format" value="csv" />
</jmeter>

As stated in build.xml, you have to take the resultlog "LoadtestResults.jtl"

and process it as stated below to get the Response time, error%, etc.

java -jar CMDRunner.jar --tool Reporter --generate-csv "C:\Aggregate_Report.csv" --input-jtl "C:\tests\LoadtestResults.jtl" --plugin-type AggregateReport

hope this will help.