Skip to content
/ kbang Public

golang编写的http压力测试工具,支持不同类型请求并发,支持请求权重

Notifications You must be signed in to change notification settings

kaimixu/kbang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kbang

http 压力测试工具,支持不同类型请求并发,支持请求权重

###工具安装

$ go get github.com/kaimixu/kbang

使用方法

#####方法1(单请求并发)

   Usage: kbang [options...] <url>

options:
    -n  Number of requests to run (default: 10)
    -c  Number of requests to run concurrency (default: 1)
    -t  Request connection timeout in second (default: 1s)
    -H  Http header, eg. -H "Host: www.example.com"
    -k[=true|false]  Http keep-alive (default: false)
    -d  Http request body to POST
    -T  Content-type header to POST, eg. 'application/x-www-form-urlencoded'
        (Default:text/plain)

#####方法2(多请求并发)

   Usage: kbang [options...] -f kbang.conf

多请求并发需编写配置文件

配置文件描述

  # 多请求配置文件,[request]用于区分不同请求,
  # weight表示请求权重,如下两请求权重比例为1:2,假如总请求数为300(-n 参数指定),
  # 请求1执行100次,请求2执行200次。
  [request]
  weight = 1
  # only support GET、POST
  method = GET
  url = http://www.example.com/
  
  [request]
  weight = 2
  method = POST
  content_type = text/plain
  url = http://www.example.com/
  post_data = a=1&b=2

About

golang编写的http压力测试工具,支持不同类型请求并发,支持请求权重

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages