当前位置:网站首页>Jmeter性能测试之命令行执行和生成测试报告
Jmeter性能测试之命令行执行和生成测试报告
2022-07-26 07:31:00 【慕城南风】
准备
Jmeter有两种运行方式:一种是上面采用的界面模式(GUI)形式,会占用java虚拟机的资源;另一种是命令行模式(non-GUI)执行,这样节约资源,尤其是在持续集成时基本都是采用non-GUI模式。
配置环境变量

命令行执行
命令行格式
jmeter -n -t <testplain filename> -l <listener filename>
参数说明:
testplain filename:jmx文件的绝对路径或相对路径listener filename:执行之后结果文件名,后缀名必须是.jtl
调试压测请求
命令行下,如果想查看每个请求返回的结果,需要修改jmeter.properties配置文件

将上面的注释打开,并且值修改成true,就会打开该条记录,jmeter就会将该条信息输出到我们指定的jtl文件中,不要要注意压测过程中,会产生大量的这样的记录,真正压测时,最好不要开太多的日志记录。
实时查看压测结果
jmeter命令行下,也可以实时查看压测结果,同样是修改配置文件jmeter.properties

打开上面的summariser.name、summariser.interval、summariser.out这三个配置项,保存,重新运行jmeter,应该就可以在shell里看到统计信息了。

生成测试报告
执行命令如下
jmeter -n -t test.jmx -l result.jtl -e -o ./result_report
参数说明:
n:非GUI模式执行JMeter
t: 脚本文件(.jmx文件)的路径
l: 指定生成测试结果的保存文件(.jtl格式),此文件必须不存在
e:测试结束后,生成测试报告
o:用于存放测试报告的路径
注意:result_report 是自己创建的测试报告文件夹,每次启动命令之前,文件夹内容要和 jtl 文件一起清空,否则会报错。
查看测试报告

打开index.html

参考:
https://www.cnblogs.com/kaibindirver/p/10767105.html
https://www.cnblogs.com/zichuan/p/9135544.html
边栏推荐
- Hcip--- BGP comprehensive experiment
- PR subtitle production
- 元宇宙基础设施:WEB 3.0 chain33 优势分析
- Keras learning part: obtaining the output results of neural network middle layer
- 20220209 create a basic Servlet
- 「论文笔记」Next-item Recommendations in Short Sessions
- 数据库基础
- [classic thesis of recommendation system (10)] Alibaba SDM model
- LeetCode剑指offer专项(一)整数
- MySQL之执行计划
猜你喜欢
随机推荐
NFT digital collection system development: the collision of literature + Digital Collections
In July, glassnode data showed that the open position of eth perpetual futures contract on deribit had just reached a one month high of $237959827.
元宇宙基础设施:WEB 3.0 chain33 优势分析
Upgrade ecological proposition: what has Alibaba cloud brought to thousands of businesses?
NFT数字藏品系统开发:NFT数藏 的最佳数字营销策略有哪些
NFT digital collection system development: what are the best digital marketing strategies for NFT digital collection
Machine learning related competition website
Learning Efficient Convolutional Networks Through Network Slimming
什么是消息订阅和发布?
现在开发人员都开始做测试了,是不是以后就没有软件测试人员了?
2019 ZTE touyue · model compression scheme
力扣(LeetCode)206. 反转链表(2022.07.25)
DCN (deep cross network) Trilogy
With someone else's engine, can it be imitated?
6、MySQL数据库的备份与恢复
[keras entry log (3)] sequential model and functional model in keras
Installation of Baidu flying paste deep learning framework tutorial in Anaconda
[200 opencv routines] 231. Gray level co-occurrence matrix (GLCM) for feature description
[C language] do you really know printf? (printf is typically error prone, and collection is strongly recommended)
NFT digital collection development: digital collections help enterprise development









