用ab進行POST,GET壓力測試,且定義header及json的內容

這個之前沒做過,找了文檔。搞定。json

要求時間的單curl測試的方式以下:api

time curl http://xxxxx/hq/restapi/isStart

curl用來用post請求,且有header及請求內容app

time curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d63xxx-xxxx-xxxxf450" -d '{"lsock":[{"akcolde":"600000","marketType":"BB"}]}' 

"http://xxxxxx/hq/restapi/ime"

用ab來做吧。curl

ab -n 100000 -c 500 http://xxx/hq/restapi/isdrt
ab -n 10000 -c 100  -p "post.txt" -T "application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d6xxs-sdf-sdf09d" "http://cnxxx81/hq/restapi/queryRealTime"

post.txtpost

{"lstStock":[{"sterode":"600000","madfpe":"SH"}]}

相關文章
相關標籤/搜索