html tool

显示标签为“loadrunner”的博文。显示所有博文
显示标签为“loadrunner”的博文。显示所有博文

2024年7月15日星期一

jmeter中的Latency 与first buffer time

first buffer time



https://blog.csdn.net/weixin_43820813/article/details/123179385

https://admhelp.microfocus.com/lr/en/24.1/help/WebHelp/Content/Analysis/110200_r_GR_Server_Network_Distribution.htm

概括一下:

If the download time for a component is high, you can use this graph to determine whether the problem is server- or network-related.

  • Network time is defined as the average amount of time that passes from the moment the first HTTP request is sent until receipt of ACK.

  • Server time is defined as the average amount of time that passes from the receipt of ACK of the initial HTTP request (usually GET) until the first buffer is successfully received back from the web server.

客户端和服务端建立连接的ack被回复后【这个是连接建立成功了开始】,到服务端的第一个received back,开始响应了
PS:这样看应该就是TTFB了(https://tangowhisky37.github.io/PracticalPerformanceAnalyst/pages/spe_fundamentals/what_is_time_to_first_buffer/)


问题:ld为什么不直接命名成TTFB而是单独起名字到first buffer呢?

Latency :
https://jmeter.apache.org/usermanual/glossary.html
Latency. JMeter measures the latency from just before sending the request to just after the first response has been received. Thus the time includes all the processing needed to assemble the request as well as assembling the first part of the response, which in general will be longer than one byte. Protocol analysers (such as Wireshark) measure the time when bytes are actually sent/received over the interface. The JMeter time should be closer to that which is experienced by a browser or other application client.

概述:
上面看和TTFB也没有多少区别,唯一jmeter说自己更是浏览器的TTFB而不是wireshark的TTFB这个是把客户端的操作系统内核时间加到这个过程了,
那First Buffer也没说自己是哪个?这样应该就都是应用级别的多了

那Latency基本就是 TTFB只是Jmeter这里没有再区分 成network time和server time了。

[popexizhi: 之前一直以为first buffer 在jmeter没有,看来是自己浅薄了:)]


参考:

https://stackoverflow.com/questions/3957991/jmeter-response-times-ttfb-or-ttlb

https://jmeter.apache.org/usermanual/glossary.html

https://admhelp.microfocus.com/lr/en/24.1/help/WebHelp/Content/Analysis/110200_r_GR_Server_Network_Distribution.htm


https://tangowhisky37.github.io/PracticalPerformanceAnalyst/pages/spe_fundamentals/what_is_time_to_first_buffer/

2023年3月30日星期四

转:loadrunner的Total Throughput (bytes)所统计数量

 参考:https://blog.csdn.net/he_jian1/article/details/41746187

总结:loadrunner中Total Throughput (bytes)所统计数量是,在整个测试过程中,从服务器返回给客户端的所有字节数,与发送请求的字节数无关!

[popexizhi: 自己核对过服务端的网卡rx 和 tx 数据监控,确实不是rx的值!!!]

一、在性能测试当中,特别利用loadrunner性能测试后,结果分析当中的一个吞吐量的指标,这个吞吐量是指服务器处理客户端请求的响应总字节数,不包括 客户端发给服务器请求字节数,这个指标和每秒请求数,有直接关系,影响因素有响应时间,及在链路层的因素有关;Throughput为吞吐量,按照常规理解网络吞吐量表示在单位时间内通过网卡数据量之和,其中即包括本机网卡发送出去的数据量也包括本机网卡接收到的数据量,但这个理解在Loadrunner记录的Throughput中是错误的!




二、以下是转自一位网友的真实测试数据如下:


此数据是用BAIDU.COM为测试数据:


1、使用VUGen录制baidu的首页,仅打开首页即可


  2、在Recording Log中记录客户端和服务器端的数据发送情况,统计发出的字节总数和接收到的字节总数。


  Recording Log内容如下:


  Request Connection: Remote Server @ 220.181.6.19:80 (Service=) (Sid= 1) PROXIED!


  "GET /"


  (Sid: 1) Client -> Server : 407 bytes (Service=HTTP)


  (Sid: 1) Server -> Client : 208 bytes (Service=HTTP)


  (Sid: 1) Server -> Client : 1990 bytes (Service=HTTP)


  "GET /img/baidu_logo.gif"


  (Sid: 1) Client -> Server : 457 bytes (Service=HTTP)


  (Sid: 1) Server -> Client : 1779 bytes (Service=HTTP)


  Address lookup for test75 = 10.10.10.1


  Request Connection: Remote Server @ 220.181.5.21:80 (Service=) (Sid= 2) PROXIED!


  "GET /img/gs.gif"


  (Sid: 2) Client -> Server : 450 bytes (Service=HTTP)


  "GET /js/bdsug.js?v=1.0.1.0"


  (Sid: 1) Client -> Server : 460 bytes (Service=HTTP)


  (Sid: 1) Server -> Client : 2581 bytes (Service=HTTP)


  (Sid: 2) Server -> Client : 369 bytes (Service=HTTP)


  (Sid: 2) Connection Terminated (by Server)


  其中发出总数为:1774


  接收字节总数为:6927


  那么loadrunner运行后,Throughput记录的是发出的字节数呢还是接收的字节数呢,或者还是两者之和呢?我们接下来继续做!


  3、在run time setting中设置该脚本运行10次


  也就是说发送总字节数为17740,接收总字节数为69270


  4、在Controller中运行该脚本,场景运行模式设置为:Classic schedule


  start vusers设置为:simultaneously


  duration设置为:run until completion


  5、我们预计一下运行该场景的结果,其中吞吐量的数值应该是69270就证明了我们说法


  6、运行场景


  7、场景运行完成后,点击analysis results生成分析结果报表


  Analysis Summary Period: 16/02/2009 15:51:55 - 16/02/2009 15:52:08


  Scenario Name: Scenario1


  Results in Session: C:\Documents and Settings\test\My Documents\lr_http\res\res.lrr


  Duration: 13 seconds.


  Statistics Summary


  Maximum Running Vusers: 1


  Total Throughput (bytes): 69,270 (


与接受到的总字节数一样)


  Average Throughput (bytes/second): 4,948


  Total Hits: 40


  Average Hits per Second: 2.857 View HTTP Responses Summary


  总结:loadrunner中Total Throughput (bytes)所统计数量是,在整个测试过程中,从服务器返回给客户端的所有字节数,与发送请求的字节数无关!


Error: Mercury File Transfer: You are running under secure mode and netdir XXX is not safe.

处理:

负载生成器的路径改使用默认的,就可以了

但原因不是很清楚,当前是server2012 /win10 os,感觉和操作系统版本有关闭

转:Error (-81024): LR_VUG: The 'QTWeb' type is not supported on 'WIN32' platforms

 参考:https://blog.csdn.net/copeming/article/details/98213372

1、找到LoadRunner安装目录:D\LR\bin,在该目录下找到Wlrun.exe,右键点击选择属性;

2、选择兼容性,选择Windows7,点击确定,重启LoadRunner

参考:https://blog.csdn.net/xun_zhao_t521/article/details/119518793

需要将LoadRunner Agent Process所对应的安装目录下的 D:\D1\TestDevelopment\tools\loadrunner\generator\bin下的magentproc.exe 设置为兼容模式win7 并使用管理员身份再次运行即可

[popexizhi:自己的是负载生成器不可以用,改magentproc.exe就可以了]

Error: CCI security error:You are running under secure mode and the function _time32 is not allowed in this mode

 问题:loadrunner 负载生成器报错Error: CCI security error:You are running under secure mode and the function _time32 is not allowed in this mode

解决:

位置在:负载生成器主机上 在 ${安装路径}\merc_asl\lrun_api.asl. 中添加

_time32=

[popexizhi: 这里err提示什么就加什么,pope使用的是time,但这里提示为_time32,加_time32才可以]

添加位置参考:【https://commonlrissues.blogspot.com/2012/09/functions-not-allowed-while-running.html】

go to the load generator machine where the above mentioned error is coming; go to the installation directory and open the folder called as "merc_asl".

There will be many "*.asl" files, each corresponding to protocols support during running Vusers over firewall. 

Open the .asl file for the protocol in a wordpad for which you are getting the above error, add your function in that file as shown below:
[Function name]= 

below the [Allowed_Functions] tag

文件参考:【https://groups.google.com/g/lr-loadrunner/c/K3DcFTZmpOg】

For general LoadRunner (lr) of C functions, you can simply append the function with an equal sign to the end of the lrun_api.asl.
EXAMPLE: To add a function called 'lr_save_value', add the following to the end of the file:



2023年3月17日星期五

Error -27780: [GENERAL_MSG_CAT_SSL_ERROR]的再次处理

 问题:

连接v1.2版本的nginx 

提示Error -27780: [GENERAL_MSG_CAT_SSL_ERROR]


解决:https://blog.csdn.net/cxm19830125/article/details/109313982

.nginx上需要配置如下:

    listen 8888 ssl;

    ssl_certificate   /data/kenossl/keno.crt;

    ssl_certificate_key   /data/kenossl/keno.key;

    ssl_session_timeout 5m;

    ssl_protocols  SSLv3 TLSv1 TLSv1.1 TLSv1.2;

    ssl_ciphers    ALL:!ADH:!EXPORT56:-RC4+RSA:+HIGH:+MEDIUM:!EXP;

    ssl_prefer_server_ciphers on;


后记:Ld11 要升级了,ssl版本太老了 :)


2021年11月24日星期三

loadrunner 使用秒钟表示时间


long t;
time(&t);  //参考: https://blog.csdn.net/q11w2212/article/details/8474725
lr_save_int(t,"event_time"); // lr_save_string -h1
...
 web_custom_request("report_log",
              "URL=http://tq:9091/v1/log",
                       "Method=POST",
                       "Resource=0",
                       "RecContentType=text/html",
                       "Referer=",
                       "Mode=HTML",

                       "EncType=application/json",
					   "Body={\"event_time\":{event_time}}",
                       LAST)


参考:https://blog.csdn.net/q11w2212/article/details/8474725

Action()
{
    long t;
    time(&t);//获取当前时间
    lr_message("直接获取当前时间的结果是:%s",ctime(&t));
    return 0;
}

运行结果:直接获取当前时间的结果是:Wed Jul 04 14:01:39 2007

2021年11月16日星期二

loadrunner负载生成器的默认结果位置

 参考:https://cloud.tencent.com/developer/article/1505739

设置负载生成器ip时,如果Temporary directory目录为空,那么运行时, LoadRunner存储临时文件在负载生成器上,由负载生成器变量TEMP、TMP变量指定的临时目录.

2021年11月3日星期三

LoadRunner上传文件

 参考:https://cloud.tencent.com/developer/article/1199644?from=article.detail.1503451

     web_submit_data("file_upload",

                   "Action=http://tupload:8080/api/file/upload",

                   "Method=POST",

       	           "EncType=multipart/form-data;charset=UTF-8;Boundary=__X_PAW_BOUNDARY__",

                   "RecContentType=text/html",

                   "Mode=HTTP",

                   ITEMDATA,

	           "Name=apikey","Value=c0d8445733b049dc9c3d4a6a3005de46f15462f97cf344b9a4d43ebc809a1c39",ENDITEM,

                   "Name=file", "Value=f:/1.prn", "File=yes", ENDITEM,
      LAST);

ld: urlencode url

 参考:

https://vsprasad.wordpress.com/2016/05/25/loadrunner-convert-html-data-to-url-data-or-url-data-to-html-data-and-pass-it-to-the-loadrunner-request/

https://admhelp.microfocus.com/vugen/en/2021-2021_R1/help/function_reference/Content/FuncRef/web/examples/lrFuncRef_WVF_w_conv_prm_Example.htm

https://blog.csdn.net/genius5200/article/details/7890285 [popexizhi:这个地址有单独的方法,看着不错,但我没有尝试]


  lr_save_string(lr_eval_string("{url}"),"curl"),
  web_convert_param("curl", "SourceEncoding=PLAIN","TargetEncoding=URL", LAST );
  lr_output_message("%s", lr_eval_string("{curl}"));  
	
  


2021年11月2日星期二

转:Loadrunner使用数据库参数化报错“Failed to read file *** \*.dat from line 1,check format”

 https://blog.csdn.net/kk_gods/article/details/118389879

报错:

Loadrunner使用数据库参数化报错“Failed to read file *** \*.dat from line 1,check format”


错误原因:

参数化的文件中对应报错行+1中包含当前的分隔符,并且分割后导致文件的此行提供数据与之前的不一致


解决方法:

修改file format不使用其他分隔或者对此行+1的数据进行处理



2021年10月20日星期三

ld 中 occurrence为当前迭代多次出现 每次都取新值

 实验:

Action()

{

lr_output_message("%s",lr_eval_string("{NewParam}"));

lr_output_message("%s",lr_eval_string("{NewParam}"));

lr_output_message("%s",lr_eval_string("{NewParam}"));

return 0;

}

其中{NewParam}来源于file,取值为each occurrence + Sequentail 

测试结果:

Starting action Action.

Action.c(3): 00003d18b58ae0e60a567ca9956e43993de2c49965e423e9fa9719d887a10c95

Action.c(4): 0000aa3782882660e71d3f12df57534ba469d331d6d8bfcb7e1a5875c8cd3de1

Action.c(5): 0000cd1b059df91f5bfd78d8af3b3b1faae2053e5aaa11954e16ddf7213d0d19

Ending action Action.

转:ld中c与web_str的转换

 参考:https://www.jianshu.com/p/7a6f1b0699e9


web参数 存储在c变量中

char sha[64]=""; //存储64位使用

//lr_eval_string("{param}"):取出参数{param}中的值,可嵌套在其他函数里使用

strcpy(sha,lr_eval_string("{sha256}")); 

lr_output_message(sha);

file中参数存储在 web参数中

lr_save_string(lr_eval_string("{sha256}"),"csha256"), //定义 csha256 存储 {sha256}中的内容

lr_output_message("%s",lr_eval_string("{csha256}"));

2021年10月19日星期二

转:Failed to send data by channels - post message failed.

 参考:https://www.cnblogs.com/onmyway20xx/p/3963090.html

问题:ld 并发时出现很多的Failed to send data by channels - post message failed.

解决:

把controller中的Diagnotics-configure-Web Page Diagnotics默认的Enable关掉

【Diagnotics-configure-Web Page Diagnotics 是网页细分图的使用,

参考:https://www.cxymm.net/article/u011391839/106020207

Web Page Diagnostics (以下简称WPD),这是LR Analysis中非常重要的一块,搞清楚这部分的内容会让你少走很多弯路,很多环境问题都可以通过它来定位,比如客户端,网络。通过它可以你可以比较好的来定位是环境的问题还是应用本身的问题,当然更重要的是Web页面本身的问题。

Web Page Diagnostics:页面诊断图,也叫页面分解总图

“页面分解”显示某一具体事务在测试过程的响应情况,进而分析相关的事务运行是否正常。

此视图下面的文件结构大体上与scripts中actions/transaction/web_url(or submit_form_request)等一系列客户端请求 这三层体系结构类似。

】

2021年9月27日星期一

转:【Loadrunner】Loadrunner Vuser 两种运行方式【error:not enough memory解决方案】

 

报错原因:都消息内存,之前用户是按线程跑,一个进程开了多个线程,其中有部分内存是这些线程共享的,出错应该是内存出现冲突了不够用了。现在用户是按进程跑,内存应该是独立的了.

>>如果跑场景的时候老是报错内存不足,那么可以尝试修改loadrunner-F4的默认设置(线程改成--->进程<https://blog.csdn.net/jackYangyang/article/details/21706469>)

解决方案:

变更这里的设置,其余设置不变。

说明文字:

loadrunner controller将使用驱动程序mmdrv运行Vuser。用户可以在controller的run-time setting中选择Vuser的运行方式,是多进程方式or多线程方式。

如果选择以线程方式来运行虚拟用户:

在场景设置时,“是单行脚本,还是多行脚本”会决定系统启动的进程数的多少:

假设并发用户设置为30,如果是单行30个用户,系统只需启动一个进程;

假设并发用户设置为30,如果是多行,30行,每行一个用户,系统就需要启动30个进程;

如果选择以进程方式来运行虚拟用户:

那么无论脚本在场景组中怎么设置,是单行多用户还是多行少用户方式,系统需要启动的进程数是一定的,就是并发用户的总数;

进程方式和线程方式的优缺点

如果选择按照进程方式运行,每个用户都将启动一个mmdrv进程,多个mmdrv进程会占用大量内存及其他系统资源,这就限制了可以在任一负载生成器上运行的并发用户数的数量,因为负载机的资源(内存及其他系统资源)是有限的。

如果选择按照线程方式运行,在默认情况下,controller为每50个用户仅启动一个mmdrv进程,而每个用户都按线程方式来运行,这些线程用户将共享父进程的内存段,这就节省了大量内存空间,从而可以在一个负载生成器上运行更多的用户。(如果选择线程方式来运行用户,每个进程中会多出几个线程,例如是53个,多出来的进程可能是用于维护进程之间的运行的)

选择线程方式虽然可以减少启动的mmdrv进程数,减少了内存的占用,但是也容易出现一个问题,例如,同一个测试场景,用线程并发就会出现超时失败或报错,而用进程并发就没错。为什么呢?因为线程的资源是从进程资源中分配出来的,因此同一个进程中的多个线程会有共享的内存空间,假设a线程要用资源就必须等待b线程释放,而b线程也在等待其他资源释放才能继续,这样就会出现这个问题。

系统需要启动的mmdrv进程数与哪些因素有关:

与在controller的运行时设置中选择的是进程方式or线程方式来运行虚拟用户有关

进程方式:无论是单行or多行脚本,需要启动的进程数就是并发用户数;

线程方式:假设是单行脚本,每50个用户才启动一个进程;多行脚本,有几行(每行<50人)就启动几个进程,而不是每个用户启动一个进程。

如果选择了线程方式,需启动的进程数,进一步还与脚本是单行还是多行有关

单行脚本,多用户,假设少于50,只需启动一个进程,100个用户,只需启动2个进程,依此类推;

多行脚本,即使每行一个用户,也需要启动一个进程,多一行就需要多启动一个进程;不是每个用户启动一个进程,有几行(每行<50人)就需要启动几个进程。

在启动了IP欺骗功能后,所需启动的进程数,还与选择的是按进程还是按线程来分配IP地址有关

按进程分IP:每个ip(负载生成器)就需要多启动一个进程;

按线程分IP:每个ip(负载生成器)不需要多启动一个进程。

 

一般来说 JAVA VUSER项目用进程模式,WEB用线程.但是如果WEB项目发现有线程冲突(TPS突然降低为0,而压力机、服务器等都无性能瓶颈时),也需要改成以进程模式运行

转载地址: https://www.codeprj.com/blog/96182b1.html

2021年9月26日星期日

转:修改windows服务器最大的tcp连接数

在做性能测试测试时候,如果被测试的系统页面很简单,并且性能很好,这样会导致压力机得tcp链接数不够而导致如下错误:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\TcpTimedWaitDelay to 30
and HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\MaxUserPort to 65534
and rebooting the machine
See the readme.doc file for more information

通过百度搜索介绍最多的还是让修改TimedWaitDelay 和MaxUserPort这2个值,其中是将TimedWaitDelay修改的相对小点,可以根据实际情况来定,

同时将MaxUserPort这个值修改大些,但是修改完并重启机器后,该问题仍然存在,通过多方查资料,然后对一些注册表进行修改:

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] 
TcpNumConnections = 0x00fffffe (Default = 16,777,214) 
以上注册表信息配置单机的最大允许的TCP连接数,默认为 16M。这个数值看似很大,这个并不是限制最大连接数的唯一条件,还有其他条件会限制到TCP 连接的最大连接数。 
最大动态端口数 
TCP客户端和服务器连接时,客户端必须分配一个动态端口,默认情况下这个动态端口的分配范围为 1024-5000 ,也就是说默认情况下,客户端最多可以同时发起3977 个Socket 连接。我们可以修改如下注册表来调整这个动态端口的范围 
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] 
MaxUserPort = 5000 (Default = 5000, Max = 65534) 

最大TCB 数量 

系统为每个TCP 连接分配一个TCP 控制块(TCP control block or TCB),这个控制块用于缓存TCP连接的一些参数,每个TCB需要分配 0.5 KB的pagepool 和 0.5KB 的Non-pagepool,也就说,每个TCP连接会占用 1KB 的系统内存。 

系统的最大TCB数量由如下注册表设置决定 
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters] 
MaxFreeTcbs = 2000 (Default = RAM dependent, but usual Pro = 1000, Srv=2000) 
非Server版本,MaxFreeTcbs 的默认值为1000 (64M 以上物理内存) 

Server 版本,这个的默认值为 2000。 

也就是说,默认情况下,Server 版本最多同时可以建立并保持2000个TCP 连接。 
最大TCB Hash table 数量 

TCB 是通过Hash table 来管理的,下面注册表设置决定了这个Hash table 的大小 

HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters] 
MaxHashTableSize = 512 (Default = 512, Range = 64-65536) 

这个值指明分配 pagepool 内存的数量,也就是说,如果MaxFreeTcbs = 1000 , 则 pagepool 的内存数量为 500KB 

那么 MaxHashTableSize 应大于 500 才行。这个数量越大,则Hash table 的冗余度就越高,每次分配和查找 TCP  连接用时就越少。这个值必须是2的幂,且最大为65536. 

    MaxUserPort = 65534 (Decimal) 
    MaxHashTableSize = 65536 (Decimal) 
    MaxFreeTcbs = 16000 (Decimal) 

这里我们可以看到 MaxHashTableSize 被配置为比MaxFreeTcbs 大4倍,这样可以大大增加TCP建立的速度。

原始地址:https://blog.51cto.com/lya041/706088

2021年9月21日星期二

转:loadrunner "Granularity must be an integer between 5 "处理

 https://www.northwaysolutions.com/open-loadrunner-analysis-graphs-with-custom-granularity/

  1. Select the “Automatically set to new result” checkbox. As a result, each new result set will be opened with the above graphs and granularity desired, with the exception of the Throughput graph. For the Throughput graph, the minimum granularity is 5 seconds by the product design. The reason for it is to avoid too much overhead.

If you would like to set it to a lower value (not recommended due to overhead), here’s what you can do (before you run your scenario):

Note: Please back up your files before any modification.

  1. 1. Open the default.cfg file of the script using a word editor. In the [WEB] section add one more line:[WEB]WebGraphsAggregation=n where n is the number of seconds for graph aggregation.
  2. Open throughput.def in the bin\dat directory using a word editor. In the [Granularity] section, comment out “BaseGranularityUIName” by putting a semicolon at the beginning of the line: Example:[Granularity]
    Dimension=Scenario Elapsed Time
    ;BaseGranularityUIName=Throughput
  3. Open Result0_Graph2.def in \AnalysisTemplates\DefaultTemplate1 using a word editor. In the [Granularity] section, comment out “BaseGranularityUIName” by putting a semicolon at the beginning of the line: Example:[Granularity]
    Dimension=Scenario Elapsed Time
    ;BaseGranularityUIName=Throughput
  4. Save the changes and rerun your scenario.

2019年12月15日星期日

loadrunner : Action.c(7): Error -27778: SSL protocol error when attempting to connect with host

问题: ssl
Action.c(7): Error -27778: SSL protocol error when attempting to connect with host "blog.csdn.net"
解决:
run-time settings -->preferences-->advanced-->WININET replay instead of Sockets,勾选保存设置后,再次运行就不会报错了(设置之后使用winlnet的引擎回放脚本,但此方法仅适用于windows)

参考:

发生原因
Loadrunner默认发送是通过sockets(将http转换为sockets)发送的,而sockets默认SSL的版本为SSL2和SSL3。HTTPS协议录制的脚本以SSL3版本回放时使sockets端口连接失败,会被服务器拒绝连接。

后遗症:
run-time-setting→preference→advanced 中勾选了Winlet reply instead of sockets 这个选项打开后影响查看网页细分图web page diagnostic的创建
参见:https://bbs.csdn.net/topics/392039669
所以这里出现了使用上的悖论

后记:
此问题在Winlet reply instead of sockets使用后CPU资源100%~90%时报错中再次出现,这个可以升级负载生成器解决,但web page diagnostic还是不可以。
最后发现是nginx的版本影响了SSL连接不能用TLS1.3引起的,升级nginx解决。

后续问题:
loadrunner的web page diagnostic和 Winlet reply instead of sockets 的冲突是什么原因?
自己可以做一个 web page diagnostic的分析吗?数据来源如何收集呢?
ld是不是要升级了?:)

2018年7月11日星期三

loadrunner自动导出html报告

参考:
https://motevich.blogspot.com/2007/10/loadrunner-analysis-report-command-line.html
[popexizhi:
pope用的是11.0,这个位置打开是如下:
这里
1.添加了要求的图表后;
2.再新建一个模板;
3.将其设置为默认模板(所有的模板都保存在%loadrunner_home%\Analemplates\htmlTest中)。
4. 之后在命令行运行如下:
>"C:\Program Files (x86)\HP\LoadRunner\bin\AnalysisUI.ex
ESULTPATH "F:\test_result\a_login_2_100_16_32.lrr"
即可
]

The next step is saving of the current report as a template:

Select menu item "Tools / Templates / Save As Template...".
As a result, "Save As Template" dlg will be shown:
I perform the following:
  • Uncheck "Automatically apply this template to a new session" checkbox.
    This will allow to load default template when I start LoadRunner Analysis. Unchecked option suits me.
  • Check "Generate the following automatic HTML report" checkbox.
    If checked, the HTML report will be generated automatically. This is what I need.
  • Check "Automatically save the session as" checkbox.
    It should be checked to correctly automatically close Analysis.
  • Check "Automatically close Analysis after saving session" checkbox.
    I recommend to enable this option. It will be irreplaceable, if you plan a batch processing - that's our case.
So, prepared "Save As Template" dialog is shown on the screen shot:
Click OK btn to save new template.
Close LoadRunner Analysis. Now we are ready to perform last action.


Start LoadRunner Analysis from command line:
  • To start only Analysys, execute the following command:
    path_to_AnalysisUI.exe
  • To open *.lrr file (LoadRunner result file) or *.lra file (LoadRunner Analysis file), execute:
    path_to_AnalysisUI.exe -RESULTPATH path_to_lrr_or_lra_file
  • To open *.lrr or *.lra file and apply a specified template, execute:
    path_to_AnalysisUI.exe -RESULTPATH path_to_lrr_or_lra_file -TEMPLATENAME name_of_template
There is an example for my template ("WinResTemplate"):
"c:\Program Files\Mercury\LoadRunner\bin\AnalysisUI.exe" -RESULTPATH C:\Temp\30users\30users.lrr -TEMPLATENAME WinResTemplate

Tips on the example:

  1. Since path to AnalysisUI.exe contains spaces, use quotes (")
  2. You have to specify name of template, not path!

That's all! 
Execute the example command from command line.
You will see that:

  1. Analysis will be loaded
  2. It will start processing lrr-file, which was produced by LoadRunner Controller.
  3. After it precesses lrr-file, Analysis will apply template. That means, needed graphs only will be created. We have specified these graphs above.
  4. Analysis will create HTML report
  5. HTML report will be saved in specified path (I used - %ResultDir%\Windows_Resources_Report.html)
  6. At the end, Analysis will be closed.

So, custom HTML report is ready without tester's intervention! Next LoadRunner test can be started from command line.