Search code examples
csvtimejmeterresponseaverage

How to calculate average response time from the csv file that JMeter produces?


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


Solution

  • 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