html tool

2013年2月19日星期二

LoadRunner的打印参数到controller和agent 的temp目录


1.在controller中打印param选择的值
i.脚本中添加打印内容
lr_output_message("user==%s",lr_eval_string("{NewParam}"));
或者
lr_message("user==%s",lr_eval_string("{NewParam}"));
ii.设置控制台打印日志
Vuser->run-TimeSettings->log
log options:
always send messages
extended log -> Parameter subsitution
iii.在controller中scenario groups选择某个运行的Vuser右键选择show Vuser log
2.这次是loadrunner agent 的设置
问题:
i.连接时提示:
controller中的提示“Connection to load generator faled”
在agent的主机上log提示如下:
19/02/2013 10:17:51 Error: Failed to write command line into file. Reason: No permission to create temp directory: 172.16.105.175\brr_YAR.483. [MsgId: MERR-29966]
19/02/2013 10:17:51 Error: Process "C:\Program Files\Mercury\LoadRunner\bin\lr_bridge.exe" was not created. Reason: error in parsing command line into file. [MsgId: MERR-29996]

在go了两天后,突然意识到可能是设置问题,loadrunner给的errid号是
26401~28000
32401~32600
82201~85000
都没有29966的位置。好吧!agent不是亲娘啊!:)
一直郁闷这个不能create temp directory是要写到什么位置为什么是172.16.105.175\brr_YAR.483 共享?%temp% or tmp 都看了的也没有啊!
解决:
controller中设置agent的内容自己写的是:
name:172.16.105.218
platform:windows
temporary directory: 172.16.105.218
晕死了,LoadRunner 的官方手册如下解释:
name: type the name of the load generator you want to add in the name box.
temporary directory: type a location, on the load generator, where the Controller can store temporay files.
这个name中写IP 或者 hostname(这个要求dns可以连接到,难怪看到好多位置这里要求配置ect/中的host文件呢);而temporary directory 是Controller存储临时文件使用在agent端的temp目录位置,不写的话默认为“ C:\Documents and Settings\Administrator\Local Settings\Temp\brr_DOK.486”其中brr_DOK.486为创建的,之前的应该是“%temp%”的内容。这样就ok了,“Error: Failed to write command line into file. Reason: No permission to create temp directory: 172.16.105.175\brr_YAR.483. [MsgId: MERR-29966]” 就是创建不了临时文件吗!pope的语言理解太是问题了temporary directory 为什么理解成ip了呢?这个是自己最大发挥的特点吧,不仔细(翻译中也老发现自己这个问题,我当谨慎谨慎再谨慎,想想有什么结构性的方式可以改进自己吧!)
不过塞翁失马,焉知非福呢?!其他收获还是不小的,list:
1.[try]-loadtool:
firebug
httpwatch
fiddler
2.[try]
loadrunner的agent 可以在linux中run,setup and try use
3.[read]
http://commonlrissues.blogspot.com/2009/03/common-errors-between-controller-and.html(要翻墙)
这篇文章写的很全,解释agent的问题,文章中甚至说到网卡的设置从自动识别修改为100Mbs/全双工,虽然不是处理pope遇到的问题,但想来多数问题应该都有了。此文很不错,详细翻译和try一下吧!
4.[thinking]
写给自己的,在agent端有两个exe分别是   magentservice.exe 和 magentproc.exe
写在系统server中的就是magentservice.exe ,而首次安装没有重启系统时启动的是magentproc.exe,开始pope认为两者没什么区别,go了一下发现http://blog.csdn.net/xu1314/article/details/7280262 ,按这里写的“测试脚本中有访问映射网络驱动器的代码,此时应该选择Process而不是Service” 好吧!看了还是有差别的。
pope发现的几个细节:这个两个exe一起启动时,新日志中就如下:
18/02/2013 17:15:42 Error: Communication error: Failed to bind socket. A process on the machine is already bound to the same address. [MsgId: MERR-10344]
18/02/2013 17:15:42 Error: Two Way Communication Error: Function two_way_comm_create_acceptor failed. [MsgId: MERR-60999]
18/02/2013 17:15:42 Error: Failed to create "launchservice" server. [MsgId: MERR-29974]
18/02/2013 17:15:42 Warning: Extension launcher.dll reports error -1 on call to function ExtPerThreadInitialize [MsgId: MWAR-10485]
18/02/2013 17:15:42 Error: Vuser failed to initialize extension launcher.dll. [MsgId: MERR-10700]

想来是端口被别人使用了,所以自己无法运行吧!

这两者的日志都在%temp%中
magentservice.exe为LoadRunner_agent_service.log
magentproc.exe为LoadRunner_agent_startup.log

没有评论:

发表评论