性能測(cè)試

  • 模擬10000個(gè)用戶(hù)
  • 查看服務(wù)器負(fù)載 (top load everage 、uptime)

任意一條數(shù)據(jù)/cpu個(gè)數(shù) > 5 超負(fù)荷,需要調(diào)優(yōu)

LoaderRunner 填寫(xiě)提交的數(shù)據(jù)

insert  --> new step  --> submitData 
添加data
查看抓取結(jié)果
查看登錄前使用的鏈接
Action()
{
// web_url("openMain","URL=http://localhost:1080/webtours/",LAST);
// 請(qǐng)求登錄前參數(shù)
web_reg_save_param("session",
    "LB= name=userSession value=",
    "RB=>",
    "Ord=1",
    LAST);

// 自定義函數(shù)
web_custom_request("customerOpen",
    "URL=http://localhost:1080/webtours/",
    "Method=GET",
    "TargetFrame=",
    "Resource=0",
    "Referer=",
    "Mode=HTML",
    "Body=",
    LAST);

// 登錄請(qǐng)求
web_submit_data("web_submit_data",
    "Action=http://localhost:1080/webtours/login.pl",
    "Method=POST",
    "TargetFrame=",
    "Referer=",
    ITEMDATA,
    "Name=userSession", "Value={session}", ENDITEM,
    "Name=username", "Value=jojo", ENDITEM,
    "Name=password", "Value=bean", ENDITEM,
    "Name=login.x", "Value=-17", ENDITEM,
    "Name=login.y", "Value=-179", ENDITEM,
    "Name=login", "Value=Login", ENDITEM,
    "Name=JSPFormSubmi", "Value=off", ENDITEM,
    LAST);
  return 0;
}
參數(shù)化運(yùn)行

變量定義必須放在首行
參數(shù)定義可以在任意位置

web查找函數(shù)特點(diǎn)
思考時(shí)間
設(shè)置思考時(shí)間
常用api匯總

要求: 事務(wù)平均響應(yīng)時(shí)間是 0.005s
1/0.005 = 200
十個(gè)用戶(hù) 2000

Paste_Image.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容