当前位置:网站首页>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
边栏推荐
- NFT数字藏品开发:数字艺术藏品赋能公益平台
- tensorflow2.x中的量化感知训练以及tflite的x86端测评
- NFT digital collection system development: the collision of literature + Digital Collections
- NFT数字藏品系统开发:华为发布首款珍藏版数字藏品
- pycharm常用快捷键
- 5. Multi table query
- PostgreSQL sequence create alter nextval Curval numerical interval gap
- NFT digital collection system development: how enterprises develop their own digital collection platform
- Anaconda 中安装 百度飞浆Paddle 深度学习框架 教程
- How to ensure the double write consistency between cache and database?
猜你喜欢

机器学习相关比赛网站

单身杯web wp

NFT digital collection development: Six differences between digital collections and NFT

Wrong Addition

【每日一题】919. 完全二叉树插入器

Compose text and icon splicing to realize drawableleft or drawableright

Simulation of transfer function step response output of botu PLC first-order lag system (SCL)

Hcip--- BGP comprehensive experiment
![PostgreSQL UUID fuzzy search UUID string type conversion SQL error [42883] explicit type casts](/img/ba/28afaead68c9ff47d15d5c5395d9ce.png)
PostgreSQL UUID fuzzy search UUID string type conversion SQL error [42883] explicit type casts

:app:checkDebugAarMetadata 2 issues were found when checking AAR metadata: 2 issues were found when
随机推荐
Selenium: detailed explanation of browser crawler use (I)
Crawler data analysis
NFT digital collection system development: how enterprises develop their own digital collection platform
Download and install the free version of typora
5. Multi table query
4、数据的完整性
System architecture & microservices
WCF deployed on IIS
“尝鲜”元宇宙,周杰伦最佳拍档方文山将于7月25日官宣《华流元宇宙》
6. Backup and recovery of MySQL database
DADNN: Multi-Scene CTR Prediction via Domain-Aware Deep Neural Network
NFT数字藏品系统开发:文学+数字藏品的碰撞
Regression analysis code implementation
Apache dolphin scheduler 2.x nanny level source code analysis, China Mobile engineers uncover the whole process of service scheduling and start
TensorFlow学习日记之tflearn
NFT数字藏品系统开发:企业如何开发属于自己的数藏平台
Compose Canvas line chart
[C language] do you really know printf? (printf is typically error prone, and collection is strongly recommended)
【Keras入门日志(3)】Keras中的序贯(Sequential)模型与函数式(Functional)模型
Compose text and icon splicing to realize drawableleft or drawableright