如何在CSV文件中保存“查询执行行数"在Jmeter中 [英] How to save in CSV file "rowcount of query execution" in Jmeter
问题描述
我已经在Jmeter中创建了一个测试计划,该计划执行某些查询并将经过的时间存储在csv文件中.我需要针对每个采样器请求保存行数.我该如何实现?
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?
下面是我的CSV文件配置
Below is my CSV file configuration
推荐答案
-
不要使用任何JMeter侦听器来存储测试结果,以类似命令行非GUI的方式运行测试
jmeter -n -t test.jmx -l result.jtl
,当您的测试完成时,请使用您选择的侦听器打开 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.
回到您的问题.假设您有一个JMeter变量,其中包含一些有趣的"值,并且您希望将此变量值添加到测试结果中,只需定义 sample_variables
属性并将变量名放在此处即可.例如,如果您有一个名为 rowcount
的JMeter变量,则将下一行添加到 user.properties 文件中:
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
下一次运行测试时,您会在.jtl结果文件中看到一个名为 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.
这篇关于如何在CSV文件中保存“查询执行行数"在Jmeter中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!