??????????????????????????
??????????????????????????δ????????????????????????????????ó??????????????£????????θ??????????????????????????????????????????
????LoadRunner??????EJB ???????????Щ????Java ?????????????÷????????????????÷????????????Щ???????????????ó???????????????????????????????
????????LoadRunner?? ??????????????????????? ????Controller ?????????????????????????????????????????HTML ?????????????????????????????????????????????????ж??????????????ó??????????Щ?????????HTML ???????????????乫???????????????????????????????
???????????????±?????????????????LoadRunner®??????BEA?м????????????????????????LoadRunner????????????????
???????????
????1?? LoadRunner?????????
????LoadRunner????????????Virtual users???????????????????????????????????????????????????controller station????????1?????
??????????????????????????????????????????????н????LoadRunner????Virtual User Generator???????????????????
????2?? ???Vugen?????????????н??
????A???????????????Virtual User Generator??
????B???????????Э?????????Э???????"Tuxedo 7"
????C??????????????????Tuxedo?????????????????????SimpApp.exe?????????"Record into Action"?Action??
???????"OK"?????????????Vugen?????Simpapp.exe????????????????WSNADDR?????????????Tuxedo is powerful!????????TOUPPER??TUXEDO?????????????????????????TUXEDO IS POWERFUL????д??"Output string"?У?????????????
????D????Vuser???????C?????????в???????????????????????????????У??????????£????????simpapp??
??????????????£?
#include "lrt.h"
#include "replay.vdf"
Actions()
{
lrt_tuxputenv("WSNADDR=//172.22.32.25:7110");
lr_think_time(3);
tpresult_int = lrt_tpinitialize(LRT_END_OF_PARMS);
lrt_abort_on_error();
data_0 = lrt_tpalloc("STRING"?? ""?? 1);
lrt_strcpy(data_0?? sbuf_1);
data_1 = lrt_tpalloc("STRING"?? ""?? 1);
tpresult_int = lrt_tpcall("TOUPPER"?? data_0?? 0?? &data_1?? &olen?? 0);
lrt_abort_on_error();
lrt_tpfree(data_0);
lrt_tpfree(data_1);
lrt_tpterm();
return 0;
}
?????????м????????LoadRunner??TUXEDO?????????????
????E????????????е?"???"????????????????????????????????
????3?? ??????????Controller???????????????
????A???????????????Controller??
????B??????????μ?Scenario???????????????simpapp????
???????"OK"??????Scenario??????檔??"Quantity"??????100????????100?????????????????????????LICENSE?й?????
????C?????"Edit Schedule"????????????
????D?????"Runtime settings"????????????á?
??????Pacing???????У?"Number of Iterations"????????Vusers??Actions????е??????"Start new iteration"???????????????????????????Vusers??Actions??
????"Think Time"????????Vusers??????????????????????????????????????"Ignore think time"??????????????????????????????á?"As recorded"??????????????????????"Multiply recorded think time by"???Vusers??????????????????????????
??????"Miscellaneous"???????Щ????????y??????????????????TUXEDO??????????????????
????E?????"Start scenario"????????????????????
??????н?????????£?
??????????5??41??Vusers?????100?????????Actions?????????5625?????????????5.561??TPS?17.8??[1]
????LoadRunner???
????1??VuGen????????????????? ??????????????????????????????????? ????????????????????
????2??Controller ???????????????????????????????????????
????3??Load Generator????????????????????????????????????????
????4??Analysis ??????????????????????????????????????
??????????
?????????????????????????LoadRunner?????????
????LoadRunner????????????????????????????????????Щ?????????????????
???????????????????????????????????????????SQL ID??SQL?????????????????ж??SQL??棬?????????SQL?????У???????????????????С????????????????????
??????????????????SQL???????????????????????????????
????????????SQL?????????????????£?????????????????????SQL????????????????????????????????????????????????????????????????????????
??????????????????????LoadRunner?а???????????????????SQL????????????????????????????SQL?????????????????????
??????????У??????????????漰?????????????loadruner????????????????????????????????趨????????????SQL??????????SQL???????????б??е??????
????????????loadrunner????????????????????SQL ID??????????????SQL???????????б??е??????
????LoadRunner?У??????????rand()????????????0??rand_max??????????????????????
????int rand ( void );
???????????rand??????????????????????????????????????srand()?????????????????
????int srand ( seedTime );
??????????????????????????????????????????????????£?
//generate rand number
int rNum = 0;
srand(time(NULL));
rNum = rand() % 10;
lr_output_message(”the number is :%d”??rNum); //print the current random number
????????????????????????if … else … ??????????????SQL????????????Ρ??????????????£?
//get certain SQL and random value
if (rNum>=0 && rNum<2) {
web_url(”test”?? “URL=http://host_name:8080/interface?sqlId=sqlid_name2&value={random_para2} “??
”Resource=0″??
”RecContentType=text/html”??
”Referer=”??
”Snapshot=tn.inf”??
“Mode=HTTP”??
LAST);
}

else if(rNum>=8 && rNum<10){
web_url(”test”?? “URL=http://host_name:8080/interface?sqlId=sqlid_name2&value={random_para2} “??
”Resource=0″??
”RecContentType=text/html”??
”Referer=”??
”Snapshot=tn.inf”??
“Mode=HTTP”??
LAST);
}
else {
rNum = 0;
lr_output_message(”the number is :%d”??rNum);
}
???????sqlid_name??SQL ID?????random_para?????file????????????????tn??web_url??????????????
??????????????????????????????????????????????????Controller????С??????й????У?Vuser??????????????????????SQL??????????SQL?е??????????????SQL???