性能测试工具比较:LoadRunner vs JMeter - 测试结果数据比较
来源:互联网 发布:linux 动态调试工具 编辑:程序博客网 时间:2024/04/30 03:40
对web请求(HTTP/HTML)进行性能测试,确认请求响应时间。分别使用Loadrunner和JMeter进行测试,比较测试结果。
1、LoadRunner测试web请求响应时间
1.1 编制(录制)脚本
创建单协议(HTTP/HTML)脚本,调用如下web_url,作为一个简单事务:
lr_start_transaction("test");
web_url("www.baidu.com",
"URL=http://www.baidu.com/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Snapshot=t1.inf",
"Mode=HTML",
LAST );
lr_end_transaction("test");
1.2 运行时设置
在Virtual User Generator,打开Vuser/Runtime Setting,设置browser emulation。设置每个迭代使用新的vuser,同时不使用cache,模拟用户第一次发送请求效果,如下:
图1 设置browser emulation
1.3 单个用户运行
设置脚本以单用户在vu generator中运行,迭代10次。
通过调用lr_start_timer和lr_end_timer函数获取web_url消耗时间,调用lr_get_transaction_wasted_time获取事务浪费时间,并调用lr_output_message打印到replay log中。
执行结果:
Action.c(129): web_url("www.baidu.com") was successful, 24357 body bytes, 2474 header bytes, 38 chunking overhead bytes [MsgId: MMSG-26385]
Action.c(144): web_url elapsed = 1.085238
Action.c(167): lr_get_transaction_wasted_time = 0.868584
Action.c(172): Duration = 1.118885 , Waste = 0.868584
Action.c(182): Notify: Transaction "DL_PC" ended with "Fail" status (Duration: 1.1315 Wasted Time: 0.8686).
Action.c(185): actualElapsedTime = 1.146042
上述消息显示,web_url请求成功返回,消耗时间1.085238秒,其中浪费时间0.868584秒。注意,Duration值稍大于web_url elapsed时间。
那么,该事务的实际消耗时间,应该是Duration - Wasted Time,为0.2629秒。10次迭代平均值约为0.255秒,见下表。
表1 LR测试的web_url请求平均duration时间和浪费时间
迭代次数
1
2
3
4
5
6
7
8
9
10
2~10次平均
web_url time
1.408252
0.231590
0.371534
0.416005
0.235011
0.215672
0.255214
0.215151
0.211167
0.255022
0.267374
wasted_time
0.910228
0.018863
0.010128
0.013624
0.010553
0.010947
0.010819
0.010799
0.011404
0.010636
0.011975
接下来,在JMeter上执行相同的操作,记录单个请求的平均响应时间。
2、 JMeter测试web请求响应时间
2.1 测试计划
在JMeter测试计划的线程组下,添加HTTP Cache Manager,勾选clear cache each iteration?,以使得每次迭代模拟用户第一次操作效果。
然后添加测试HTTP采样器,集合报告,查看结果树等等。
HTTP采样器的路径填写:http://www.baidu.com/。
2.2 单线程组运行
线程组的线程数属性设为1,迭代次数设为10,ramp-up设为0。
执行结果
---未完成
- 性能测试工具比较:LoadRunner vs JMeter - 测试结果数据比较
- LoadRunner 同开源性能测试工具 OpenSTA 的比较
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 测试工具LoadRunner和OpenSTA比较分析
- 添加NDK 变量到 .bashrc 里面的错误
- 加班与效率
- Linux系统权限简介(一)
- 黑马程序员-异常
- Hadoop (CDH4发行版)集群部署 (部署脚本,namenode高可用,hadoop管理)
- 性能测试工具比较:LoadRunner vs JMeter - 测试结果数据比较
- 别的程序员是怎么读你的简历的
- android源码相关
- 设计院各岗位职责
- 文档转换
- 如何在选中的Checkbox中取值
- /etc/group文件详解
- linux下查找进程及终止进程操作的相关命令
- ErlangOTP学习-Erlang基础学习