GithubHelp home page GithubHelp logo

songenjie / fasthttploader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hagen1778/fasthttploader

0.0 1.0 0.0 811 KB

Http benchmark (kinda ab) with autoadjustment and charts based on fasthttp library

License: MIT License

Go 97.59% CSS 1.78% JavaScript 0.63%

fasthttploader's Introduction

Go Report Card

fasthttploader (Go 1.7+)

Fasthttploader was created to simplify http benchmarking. Options like QueryPerSecond(QPS) and number of connections are not required anymore. Fasthttploader detects server possibilities by analyzing repsonses and choosing optimal conditions for testing. To avoid adjustment stage (cause it takes some extra time) - just set -q and -c flags. Fasthttploader generates html-report after testing with some useful charts.

Quickstart

Install:

go get github.com/hagen1778/fasthttploader

Run test:

fasthttploader http://google.com

Expected results:

------ Burst Throughput ------
Elapsed time: 5.000740s
Req done: 2955; Success: 100.00 %
Rps: 590.912523; Connections: 500
Errors: 0; Timeouts: 0

------ Adjustment test ------
Elapsed time: 30.000411s
Req done: 37684; Success: 100.00 %
Rps: 1256.116142; Connections: 1509
Errors: 0; Timeouts: 0

------ Loading test ------
Elapsed time: 20.000837s
Req done: 36433; Success: 100.00 %
Rps: 1821.573798; Connections: 1738
Errors: 0; Timeouts: 0

Check generated html-report: Charts with results of test

Usage

Usage: fasthttploader [options...] <url>
Notice: fasthttploader would force agressive burst stages before testing to detect 
max qps and number for clients.
To avoid this you need to set -c and -q parameters.
Options:
  -A string
        Set Accept headers
  -T string
        Set content-type headers (default "text/html")
  -b string
        Set body
  -c int
        Number of supposed clients (default 500)
  -cpuprofile string
        write cpu profile to file
  -d duration
        Cant be less than 20sec (default 30s)
  -debug
        Print debug messages if true
  -disable-compression
        Disables compression if true
  -gatewayAddr string
        Address of PushGateway service (default "localhost:9091")
  -h string
        Set headers
  -httpClientKeepAlivePeriod duration
        Interval for sending keep-alive messageson keepalive connections. 
        Zero disables keep-alive messages (default 5s)
  -httpClientReadBufferSize int
        Per-connection read buffer size for httpclient (default 8192)
  -httpClientRequestTimeout duration
        Maximum time to wait for http response (default 10s)
  -httpClientWriteBufferSize int
        Per-connection write buffer size for httpclient (default 8192)
  -jobName string
        Name of the job for PushGateway (default "pushGateway")
  -k    Disable keepalive if true
  -m string
        Set HTTP method (default "GET")
  -memprofile string
        write memory profile to this file
  -q int
        Request per second limit. Detect automatically, if not setted
  -r string
        Set filename to store final report (default "report.html")
  -successStatusCode int
        Status code on which a successful request would be determined (default 200)
  -t duration
        Request timeout (default 5s)
  -web
        Auto open generated report at browser

Stages

Testing consist of 3 stages:

  • Burst - 5sec test with no limits by QPS and number of clients equal (by default, but can be changed by -c passing) to 500. Burst stage helps to detect possible QPS rate for further stages
  • Adjustment - 30sec test with smoothly QPS and clients tunning. Initial QPS and number of clients are taken from results of Burst stage. During 30s fasthttploader would increase QPS and number of clients till timeout or getting errors
  • Testing - just loading test, based on settings achieved from previous stage.

To rebuild assets use:

go-bindata -pkg report -ignore=\\.img -o report/binddata.go report/static/...

fasthttploader's People

Contributors

hagen1778 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.