文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
Socket协议
试用业务范围
Socket协议的接口
简介
Thrift benchmark 命令行工具
支持如下网络传输协议
- protocol
- binary
- transport
- tcp socket
- unix domain
- http
- transport wrapper
- framed
- buffered
安装配置
git clone [email protected]:stdrickforce/tenchmark.git
go get -u
go install
也可以使用docker (base on alpine linux)
docker run --rm -ti stdrickforce/tenchmark sh
使用方式
- send ping request to :10010
$ tenchmark run :10010
- send ping request with multiplexed protocol
$ tenchmark run :10010 --service=<service_name>
- send ping request to :10010 via framed transport
$ tenchmark run :10010 --wrapper=framed
- send ping request via unix domain socket
$ tenchmark run /var/run/x.sock --transport=unix
- send ping request via http
$ tenchmark run http://<host>:<port>/<path> --transport=http
执行结果示意
This is Tenchmark, Version 0.1
Copyright 2017
Licensed under the MIT
Benchmarking :6000 (be patient)......
Completed 1000 requests
Finished 1000 requests
Server Address: :6000
Concurrency level: 10
Time taken for tests: 0.026 seconds
Complete requests: 1000
Failed requests: 0
Request per second: 37887.40 [#/sec] (mean)
Percentage of the requests served within a certain time (ms)
50% 0.12
66% 0.14
75% 0.15
80% 0.16
90% 0.19
95% 0.22
98% 0.25
99% 0.36
100% 13.27 (longest request)
生成测试用例
tenchmark build 命令
$ tenchmark build example/ping.thrift --json=example/api.json
cases/case1.in sucessfully generated.
指定测试用例执行测试
$ tenchmark run --case=cases/case1.in
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论