Jmeter - 命令行参数

同步更新至个人博客:https://njlife.top/2019/07/12/Jmeter-命令行参数/

Jmeter可以通过GUI模式非GUI模式执行。GUI模式用来进行配置和调试,也可以执行脚本得到一些执行结果。非GUI模式即命令模式,提供了更加灵活强大的呢功能。Jmeter官方文档也明确说明不要使用GUI模式执行负载测试。

20190712213517.png

下面是Jmeter Non-GUI模式下的命令行参数。

参数列表

参数 说明
-n This specifies JMeter is to run in cli mode 表明使用NON-GUI模式
-t [name of JMX file that contains the Test Plan] 指定.jmx文件路径
-l [name of JTL file to log sample results to] 指定结果文件.jtl路径
-j [name of JMeter run log file] 指定执行日志路径
-r Run the test in the servers specified by the JMeter property "remote_hosts" 设置分布式远程执行(在JMETER_HOME\bin\jmeter.properties中的remote_hosts配置)
-R [list of remote servers] Run the test in the specified remote servers 指定远程服务器列表
-g [path to CSV file] generate report dashboard only 指定结果文件路径,仅用于生成测试报告
-e generate report dashboard after load test 测试完成后生成测试报表
-o output folder where to generate the report dashboard after load test. Folder must not exist or be empty 指定测试报表生成文件夹。文件夹必须为空或者不存在
-H [proxy server hostname or ip address] 指定代理服务器地址(域名或者IP)
-P [proxy server port] 指定代理服务器端口

例子

jmeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000

如果配置jmeterengine.stopfail.system.exit设置成了true,在线程无法停止的情况下,Jmeter会调用System.exit(1)进行停止。默认情况下改配置是false,一般情况下用不到,在有需求的时候可以进行设置。

posted @ 2019-07-12 23:57  六月瓜  阅读(410)  评论(0编辑  收藏  举报