1
votes

I have created a test plan in Jmeter which executes certain queries and store elapsed time in csv file. I need to save row count against each sampler request. How can I achieve this?

Below is my CSV file configuration

enter image description here

1

1 Answers

1
votes
  1. Don't use any of JMeter Listeners to store test results, they don't add any value and create memory and disk IO overhead instead. You should be running your tests in command-line non-GUI mode like

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

    and when your test is finished either open result.jtl file with the listener of your choice or generate HTML Reporting Dashboard from it.

  2. Coming back to your question. Given you have a JMeter Variable holding some "interesting" value and you would like this variable value to be added to test results just define sample_variables property and put the variable name there. For example, if you have JMeter Variable called rowcount add the next line to user.properties file:

    sample_variables=rowcount
    

    and next time you run your test you will see an extra column in the .jtl results file called rowcount holding the variable value for each and every sampler. See Sample Variables User Manual chapter for more details.