1. jmeter java.net.NoRouteToHostException: Cannot assign requested address (Address not available)
壓測過程中出現此錯誤,發現網絡連接正常,服務器也是正常,網上查是客戶端(jmeter機器)端口用盡.因為socket端口釋放需要等待,默認是2min.
我用gui客戶端,所以在對應的http請求,取消勾選"keep alive"
2. 用jtl生成html報告
1)打開dos,進入到jmeter的bin目錄下
2)運行命令:jmeter -g ./Log/test.jtl -o output
3. jmeter 設置線程后等待用sampler--flow control action,這個只會緊跟在上一個sampler之后等待.
而timer定時器,是在線程開始前等待,不管放在什么位置.
4.想提取響應中的數組,進行遍歷
如提取data.children[]..title;data.children[]..type;data.children[*]..route;組成3個數組,然后遍歷這3個數組
{
"code": 0,
"data": {
"title": "一級導航欄",
"type": "APP_TABS",
"route": null,
"children": [
{
"title": "聊一聊",
"type": "ORIGINAL_CHAT_TAB",
"route": null,
"properties": null
},
{
"title": "雲塊",
"type": "eEGrQHv5",
"route": null,
"properties": null
},
{
"title": "新贊品",
"type": "CUSTOM_H5_TAB",
"route": "https:\/\/appstore.onecloud.cn?need_toolbar=false",
"properties": null
},
{
"title": "布局我的",
"type": "r66g2O8R",
"route": null,
"properties": null
}
],
"properties": null
},
"message": "success"
}
用json提取器結合2個for each控制器實現