Lr_get_transaction_think_time函数使用问题
使用Lr_get_transaction_think_time的时候获取不到思考时间?预期输出的是6,但每次输出都是0,以下是我的脚本,
Action()
{
int time ;
web_add_cookie("BAIDUID=9C6FC80EE88267DB4991F66445E4C508:FG=1; DOMAIN=www.baidu.com");
web_url("www.baidu.com",
"URL=http://www.baidu.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t34.inf",
"Mode=HTTP",
LAST);
web_add_cookie("BAIDUID=9C6FC80EE88267DB4991F66445E4C508:FG=1; DOMAIN=gimg.baidu.com");
web_concurrent_start(NULL);
web_url("gs.gif",
"URL=http://gimg.baidu.com/img/gs.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/",
"Snapshot=t35.inf",
LAST);
web_url("baidu_logo.gif",
"URL=http://www.baidu.com/img/baidu_logo.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/",
"Snapshot=t38.inf",
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("arr.gif",
"URL=http://www.baidu.com/img/arr.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/",
"Snapshot=t36.inf",
LAST);
web_url("bdsug.js",
"URL=http://www.baidu.com/js/bdsug.js?v=1.0.3.0",
"Resource=1",
"RecContentType=application/javascript",
"Referer=http://www.baidu.com/",
"Snapshot=t37.inf",
LAST);
web_concurrent_end(NULL);
web_add_cookie("BAIDUID=9C6FC80EE88267DB4991F66445E4C508:FG=1; DOMAIN=suggestion.baidu.com");
lr_think_time(10);
web_url("su",
"URL=http://suggestion.baidu.com/su?wd=java&p=3&cb=window.bdsug.sug&t=1285032703640",
"Resource=1",
"RecContentType=baiduapp/json",
"Referer=http://www.baidu.com/",
"Snapshot=t39.inf",
LAST);
lr_start_transaction("search");
lr_think_time(6);
web_submit_data("s",
"Action=http://www.baidu.com/s",
"Method=GET",
"EncType=",
"RecContentType=text/html",
"Referer=http://www.baidu.com/",
"Snapshot=t40.inf",
"Mode=HTTP",
ITEMDATA,
"Name=wd", "Value=java", ENDITEM,
LAST);
time=lr_get_transaction_think_time("search");
lr_output_message("%d",time);
web_concurrent_start(NULL);
web_url("logo-yy.gif",
"URL=http://www.baidu.com/img/logo-yy.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/s?wd=java",
"Snapshot=t41.inf",
LAST);
web_url("u.js",
"URL=http://www.baidu.com/user/js/u.js",
"Resource=1",
"RecContentType=application/javascript",
"Referer=http://www.baidu.com/s?wd=java",
"Snapshot=t43.inf",
LAST);
web_concurrent_end(NULL);
web_url("pic-tieba.gif",
"URL=http://www.baidu.com/img/pic-tieba.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/s?wd=java",
"Snapshot=t42.inf",
LAST);
web_add_cookie("BAIDUID=9C6FC80EE88267DB4991F66445E4C508:FG=1; DOMAIN=s.baidu.com");
web_url("w.gif",
"URL=http://s.baidu.com/w.gif?q=java&fm=se&T=1285032729&y=EBFBCBDF&cw=1259&path=http://www.baidu.com/s?wd=java&cid=8&qid=d2d3b81f1470d0fc&t=1285032714328",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://www.baidu.com/s?wd=java",
LAST);
lr_end_transaction("search",LR_AUTO);
return 0;
}
下面是帮助中的例子
double think_time;
lr_start_transaction ("Flight");
web_url("home;sz=234x60;tile=1;ord=977672495775323400",
"URL=http://ad.doubleclick.net/...ord=977672495775323400",
..
"Mode=URL",
LAST );
think_time=lr_get_transaction_think_time("Flight");
status = web_submit_data("flight",
"Action=http://www.mercury-tours.com/cgi-bin/tours?ITN_RESPONSE+",
"Method=POST",
"TargetFrame=",
...
LAST );
/* End transaction with operation result - pass or fail */
if (status == 0)
lr_end_transaction("Flight", LR_PASS);
else
lr_end_transaction("Flight", LR_FAIL);
if (think_time)
lr_output_message("The transaction think time is %f seconds", think_time);
else
lr_output_message("The think time cannot be determined."); 是我函数使用的位置错了吗? 放在最底下也不可以 你脚本运行的时候是不是设置了 忽略think time (默认的) 恩我试试这个的确遗忘了 3ks 问题解决 是因为忽略了think time对吧,了解一下楼主这样写的目的是什么呢 是因为忽略了think time对吧,了解一下楼主这样写的目的是什么呢 回复 7# msnshow
目的是学会使用lr函数 以便以后用得到 回复 8# kuangquanshui
原来是这样
页:
[1]