wrk压力测试POST请求

1. 编写lua脚本,填写post的数据, 如  post.lua

wrk.method = "POST"

wrk.body  = '{"userId": "10001","coinType": "GT","type": "2","amount": "5.1"}'

wrk.headers["Content-Type"] = "application/json"

function request()

  return wrk.format('POST', nil, nil, body)

end

2. 执行wrk,开始压力测试:

wrk -t 16 -c 100 -d 30s --latency --timeout 5s -s post.lua http://localhost:8021/m/zh/order/new 

wrk参数用法网上很多介绍,此处不再祥述

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容