Tenchmark

试用业务范围

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

results matching ""

    No results matching ""