go-stress-testing
https://github.com/link1st/go-stress-testing
如果没有环境可以去下作者编译好的: https://github.com/link1st/go-stress-testing/releases
go clone https://github.com/link1st/go-stress-testing.git
cd go-stress-testing
go build
执行测试:
.\go-stress-testing.exe -c 10 -n 10 -u https://www.baidu.com
返回结果:

参考
https://cloud.tencent.com/developer/article/1509809
go-wrk
https://github.com/adjust/go-wrk
操作
自身系统有 go 环境。
git clone https://github.com/adjust/go-wrk.git
cd go-wrk
go mod init go-wrk
go build
执行测试。
./go-wrk [flags] url
例子:
./go-wrk -c=400 -t=8 -n=100000 http://localhost:8080/index.html
flags
-H="User-Agent: go-wrk 0.1 bechmark\nContent-Type: text/html;": the http headers sent separated by '\n'
-c=100: the max numbers of connections used
-k=true: if keep-alives are disabled
-i=false: if TLS security checks are disabled
-m="GET": the http request method
-n=1000: the total number of calls processed
-t=1: the numbers of threads used
-b="" the http request body
-s="" if specified, it counts how often the searched string s is contained in the responses