|
我做了一个c/s结构登陆的性能测试,我用的是windows socket
第一步先录制登陆脚本,直接在action进行录制,录制完成后脚本如下
Action()
{
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.128.196:80", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lr_think_time(5);
lrs_close_socket("socket0");
return 0;
}
在data.ws中显示的是
send buf0 183
"GET /getusrinfo.php?type=2&value=syn1 HTTP/1.1\n"
"Accept: */*\n"
"Accept-Encoding: gzip, deflate\n"
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0)\n"
"Host: 192.168.128.196\n"
"Connection: Keep-Alive\n"
"\n"
recv buf1 453
"HTTP/1.1 200 OK\r\n"
"Date: Tue, 09 Jan 2007 14:49:01 GMT\r\n"
"Server: Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.7f PHP/5.1.4\r\n"
"X-Powered-By: PHP/5.1.4\r\n"
"Set-Cookie: PHPSESSID=c3c8d81645f56201c1d5db69a96fd1fe; path=/\r\n"
"Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n"
"Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-chec"
"k=0\r\n"
"Pragma: no-cache\r\n"
"Content-Length: 3\r\n"
"Keep-Alive: timeout=5, max=100\r\n"
"Connection: Keep-Alive\r\n"
"Content-Type: text/html\r\n"
"\r\n"
"4\r\n"
注释:红字部分为登陆的用户名,但是没有密码的数据,所以我根本无法进行参数替换,也就无法进行登陆的压力测试. 请教高手解答,谢谢 |
|