导航

Golang 做的几个跟性能有关的工具

Posted on 2013-10-28 18:59  蝈蝈俊  阅读(1527)  评论(0编辑  收藏  举报

1、Vegeta

https://github.com/tsenart/vegeta

Vegeta 是一个万能的 HTTP 负载测试工具,提供命令行工具和一个开发包。

使用方法:

$ vegeta attack -h
Usage of attack:
  -duration=10s: Duration of the test
  -header=: Targets request header
  -ordering="random": Attack ordering [sequential, random]
  -output="stdout": Output file
  -rate=50: Requests per second
  -targets="stdin": Targets file

 

2、gor

gor 是一个网络流量抓包和重放工具。

https://github.com/buger/gor/

Diagram

使用方法:

$ gor listen -h
Usage of ./bin/gor-linux:
  -i="any": By default it try to listen on all network interfaces.To get list of interfaces run `ifconfig`
  -p=80: Specify the http server port whose traffic you want to capture
  -r="localhost:28020": Address of replay server.

$ gor replay -h
Usage of ./bin/gor-linux:
  -f="http://localhost:8080": http address to forward traffic.
    You can limit requests per second by adding `|#{num}` after address.
    If you have multiple addresses with different limits. For example: http://staging.example.com|100,http://dev.example.com|10
  -ip="0.0.0.0": ip addresses to listen on
  -p=28020: specify port number