WebSphere Studio Workload Simulator sample script file
The following is a portion of the WebSphere® Studio Workload Simulator script file that we used in our testing. Lines that we changed are in bold for emphasis only.
//
/*trade6 version 1.3*/
init_section
{
string hostname = getparm("hostname","lnweb1:443");
int botClient = getparm_int("botClient",0);
int topClient = getparm_int("topClient",499);
shared int curClient = botClient - 1;
}
int html_percent = 10;
int gif_percent = 0;
int num_u = 500;
int num_s = 1000;
int num_stock, i;
string name, uid, add, email, holdid, stocks;
bool loop = true;
int sell_deficit = 0;
int flop;
HttpResponse r;
while (true)
{
loop = true;
start_transaction("login");
startpage(4);
thinktime(1000);
//uid = URLEncode("uid:"+random(0,num_u - 1));
//TODO: Make this random but better than above - must be random across all
clients
int clientnum;
enter_critical_section();
curClient = curClient + 1;
if (curClient > topClient)
{
curClient = botClient;
}
clientnum = curClient;
leave_critical_section();
uid = URLEncode("uid:" + clientnum);
postpage_ssl(""+hostname+"","/trade/app",1,close,0,start,"",
"uid=" +uid+ "&passwd=xxx&action=login",
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*",
"Referer: http://"+hostname+"/trade/app",
"Accept-Language: en-us",
"Content-Type: application/x-www-form-urlencoded",
"Accept-Encoding: gzip, deflate",
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
"Host: "+hostname+"",
"Connection: Keep-Alive");
endpage;
end_transaction("login");
while (loop)
{
distribute
{
weight 20:
start_transaction("home");
startpage(5);
thinktime(1000);
getpage_ssl(""+hostname+"","/trade/app",1,close,0,start,"?action=home",
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*",
"Referer: http://"+hostname+"/trade/app",
"Accept-Language: en-us",
"Accept-Encoding: gzip, deflate",
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
"Host: "+hostname+"",
"Connection: Keep-Alive");
endpage;
end_transaction("home");
⋮
Note that this is just a portion of this script.