srinivasa
srinivasa

Reputation: 31

How to get row count for a sql query executed in JDBC request in Jmeter in summary report

We are executing SQL queries on Jmeter JDBC request and able to get proper response on executions. However, our project team would like to see row count of each execution in result reports along with elapsed time, latency etc.

How to get row count for a sql query executed in JDBC request in Jmeter? Also, how to get the row count value appended to columns in Summary report.csv file?

Upvotes: 2

Views: 2059

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

  1. With regards to row count - you already have it. I.e. in the below setup I defined the result variable myVar

    enter image description here

  2. When my query is being executed JMeter stores the number of returned rows into myVar_# variable

    enter image description here

  3. Now if I want to display the variable within the .jtl results file I need to add the following line to user.properties file:

    sample_variables=myVar_#
    
  4. Next time I run my JMeter test in command-line non-gui mode like:

    jmeter -n -t test.jmx -l result.csv
    

    I see the number of rows returned by the SQL query in the myVar_# column:

    enter image description here

References:

Upvotes: 1

Related Questions