http-little-toy Yes An http concurrency testing tool written in Golang.

software address

github.com

http-little-toy: A simple http benchmarking tool. (gitee.com

introduce

The inspiration comes from various versions of wrk http concurrency testing tools on github. One day I saw a version written in go. That’s it? I can do it too. So I made a wheel myself. orz.

Building wheels is fun.

todo

  • [x] Add setting header to the command line

  • [x] Add setting body load to the command line

  • [ ] Improve the logic of the request.json request file

  • [x] Add the function of recording response data log for easy analysis

use

Generally, -d is used to control the request time (seconds), and -t is used to control the number of threads (understood as the number of users).

You can also use the request.json file, you don’t need to rewrite the command parameters, but there may be some minor problems, and it is being perfected.



$ http-little-toy -h

Usage: httpToy

Options:

-H

The http header. --default=[].

-allowRedirects

allowRedirects. --default=true.

-body

The http body. --default="".

-caCert

caCert. --default="".

-clientCert

clientCert. --default="".

-clientKey

clientKey. --default="".

-compression

Use keep-alive for http protocol. --default=true.

-d

Duration of request.The unit is seconds. --default=0.

-f

specify the request definition file. --default="".

-gen

generate the request definition file template to the current directory. --default=false.

-h

show help tips. --default=false.

-keepAlive

Use keep-alive for http protocol. --default=true.

-log

record request log to file. default: './log' --default=false.

-skipVerify

TLS skipVerify. --default=false.

-t

Number of threads. --default=0.

-timeOut

the time out to wait response. --default=1000.

-u

The URL you want to test. --default="".

-useHttp2

useHttp2. --default=false.

-v

show app version. --default=false.


Installation Tutorial

  1. Use go install directly github.com/leihenshang/http-little-toy and then put your go/bin into the environment variable, use http-little-toy with parameters, let’s take off, Sao Nian.

  2. Manually compiled into a binary file and run directly, it can be placed in a global variable and executed directly from the command line.

compile manually



# 把项目编译成可执行文件并输出到当前目录

go build -o httpToy


implement:



# 使用纯命令

./httpToy -d 10 -t 80 -u http://127.0.0.1:9090

# or

# 使用请求文件

./httpToy -d 10 -t 80 -f request_sample.json



# 使用test-server

go run . -u http://localhost:9090 -H aaa:bbbb -H ccc:ddd -body "hhhhh2333333" -d 2 -t 1


#httplittletoy #Homepage #Documentation #Downloads #HTTP #Concurrency #Testing #Tool #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *