LoadRunner中如何验证下载的文件大小、统计下载时间、度量下载速度
LoadRunner中的web_get_in_property函数可用于返回上一个HTTP请求的相关信息,包括HTTP请求返回码、下载大小、下载时间等:
The web_get_int_property function returns specific information about the previous HTTP request.
The meaning of the return value depends on the HttpInfoType argument. HttpInfoType can be any of the following options. The first constant in each pair (HTTP_*) is for C, the second (object.HTTP_*) is for object oriented languages.
HTTP_INFO_RETURN_CODE or object.HTTP_INFO_RETURN_CODE
The return code in HTTP response header.
HTTP_INFO_DOWNLOAD_SIZE or object.HTTP_INFO_DOWNLOAD_SIZE
The size (in bytes) of the last download, including the header, body, and communications overhead (for example, NTLM negotiation).
HTTP_INFO_DOWNLOAD_TIME or object.HTTP_INFO_DOWNLOAD_TIME
The time in (milliseconds) of the last download.
HTTP_INFO_TOTAL_REQUEST_STAT or object.HTTP_INFO_TOTAL_REQUEST_STAT
Returns the accumulated size of all headers and bodies since the first time web_get_int_property was issued with HTTP_INFO_TOTAL_REQUEST_STAT.
HTTP_INFO_TOTAL_RESPONSE_STAT or object.HTTP_INFO_TOTAL_RESPONSE_STAT
Returns the accumulated size, including header and body, of all responses since the first time web_get_int_property was issued with HTTP_INFO_TOTAL_RESPONSE_STAT
下面脚本发送HTTP请求下载一个PNG图片,然后用web_get_int_property取得这次请求相关的信息:
Action()
{
int returnCode;
float fFileDownloadSize, fFileDownloadTime, fFileDownloadRate;
web_url("Image1",
"URL=http://localhost/welcome.png",
"Resource=1",
LAST);
returnCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
fFileDownloadSize = (web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE)/1024.); //in kilobytes
fFileDownloadTime = (web_get_int_property(HTTP_INFO_DOWNLOAD_TIME)/1000.); //in seconds
fFileDownloadRate = fFileDownloadSize/fFileDownloadTime; //in KB/s
lr_output_message("Return Code = %d",returnCode);
lr_output_message("Size of download was %.0f kilobytes; Time of download was %.3f seconds", fFileDownloadSize, fFileDownloadTime);
lr_output_message("Rate of download was %.2f KB/sec", fFileDownloadRate);
return 0;
}
LoadRunner中如何验证下载的文件大小、统计下载时间、度量下载速度的更多相关文章
- LoadRunner中的Web 函数列表
LoadRunner中的Web 函数列表 web test LoadRunner fuction_list D:\Program Files (x86)\Mercury Interactive\Mer ...
- Loadrunner中web_find和web_reg_find函数的使用与区别
总结一下Loadrunner中的检查点函数,主要介绍两个函数:web_find()和web_reg_find():这两个函数均用于内容的查找,但两者也有本质的区别,具体介绍如下:一.web_find( ...
- 深入理解Loadrunner中的Browser Emulation
深入理解Loadrunner中的Browser Emulation 深入理解Loadrunner中的Browser Emulation 3E?']V'VgB5n*S0一:基本介绍51Testing软件 ...
- LoadRunner - 当DiscuzNT遇上了Loadrunner(中) (转发)
当DiscuzNT遇上了Loadrunner(中) 在上文中,介绍了如果录制脚本和设置脚本执行次数.如果经过调试脚本能够正常工作的话,就可以设置并发用户数并进行压力测试了. 首先我们通过脚本编辑界面上 ...
- Loadrunner中影响"响应时间"的设置
1.Runtime setting的设置 *Think time 这个就不多说了,如果忽略则"响应时间"会变短,但同时对服务器的压力增大,从而间接影响响应时间 在anlaysis里 ...
- LoadRunner中对图表的分析说明
LoadRunner中对图表的分析说明 (一)在Vusers(虚拟用户状态)中 1.Running Vusers(负载过程中的虚拟用户运行情况) 说明——系统形成负载的过程,随着时间的推移,虚拟用户数 ...
- C# 中参数验证方式的演变
一般在写方法的时候,第一步就是进行参数验证,这也体现了编码者的细心和缜密,但是在很多时候这个过程很枯燥和乏味,比如在拿到一个API设计文档的时候,通常会规定类型参数是否允许为空,如果是字符可能有长度限 ...
- Loadrunner中Throughput(吞吐量)的分析与计算
Throughput翻译为吞吐量,按照常规理解网络吞吐量表示在单位时间内通过网卡数据量之和,其中即包括本机网卡发送出去的数据量也包括本机网卡接收到的数据量,但这个理解在Loadrunner记录的Thr ...
- LoadRunner中响应时间与事物时间详解
1. 响应时间 事务是指用户在客户端做一种或多种业务所需要的操作集,通过事务函数可以标记完成该业务所需要的操作内容:另一方面事务可以用来统计用户操作的响应时间,事务响应时间是通过记录用户请求的开始时间 ...
随机推荐
- Java 原子性引用 AtomicReference
http://www.jianshu.com/p/882d0e2c3ea6 实现 原子操作 使用场景: 一个线程使用student对象,另一个线程负责定时读表,更新这个对象.那么就可以用AtomicR ...
- hdu 2236(二分图最小点覆盖+二分)
无题II Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- MATLAB多项式及多项式拟合
多项式均表示为数组形式,数组元素为多项式降幂系数 1. polyval函数 求多项式在某一点或某几个点的值. p = [1,1,1];%x^2+x+1 x = [-1,0,1];y = po ...
- 发布Office 365插件
在上一篇博客<VisualStudio 2013开发Office插件>开发完成了插件后,需要将插件发布 发布前需要: Azure 应用服务,作为Office插件的发布空间,地址是:http ...
- 执行程序(例如UltraEdit)在WIN7下添加到右键菜单
把下面提供的代码复制到记事本,保存为注册表文件(*.reg),右键合并即可.注意把最后一行换成你自己的路径. Windows Registry Editor Version 5.00 [HKEY_CL ...
- centos6.5 卸载adobeflash
# rpm -e flash-plugin # rpm -qa | grep ^flash-plugin
- ganglia笔记:rrd数据库
为了给ganglia监控的数据加上报警的功能,在jenkins里加了一个定时job,运行报警的脚本.脚本需要对ganglia记录的数据进行分析,以下是一点粗浅的理解. rrdtool的本质是用于画图的 ...
- Codeforces Round #283 (Div. 2) D. Tennis Game(模拟)
D. Tennis Game time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...
- 【指数型母函数】hdu1521 排列组合
#include<cstdio> #include<cstring> using namespace std; int n,m,jiecheng[11]; double a[1 ...
- 1.4(学习笔记)JSP自定义标签
一.JSP自定义标签 JSP自定义标签,可以通过实现Tag接口.继承TagSupport类来设置标签功能. 后续通过配置文件将标签和具体的实现类关联. 二.自定义第一个标签(实现Tag接口) 自定义标 ...