GithubHelp home page GithubHelp logo

tonyganga / baton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from americanexpress/baton

0.0 1.0 1.0 2.12 MB

HTTP load testing witten in Go

License: Apache License 2.0

Dockerfile 0.36% Go 99.64%

baton's Introduction

Baton

Baton is a load testing tool written in Go. It currently supports GET, POST, PUT, and DELETE requests.

Build Status

Install Baton

Installation of Baton with Go is as easy as running go get.

$ go get -u github.com/americanexpress/baton

Binary releases are available.

Using Baton

Baton currently supports the following options:

  -b string
    	Body (use instead of -f)
  -c int
    	Number of concurrent requests (default 1)
  -f string
    	File path to file to be used as the body (use instead of -b)
  -i	Ignore TLS/SSL certificate validation
  -m string
    	HTTP Method (GET,POST,PUT,DELETE) (default "GET")
  -o	Supress output, no results will be printed to stdout
  -r int
    	Number of requests (use instead of -t) (default 1)
  -t int
    	Duration of testing in seconds (use instead of -r)
  -u string
    	URL to run against
  -w int
    	Number of seconds to wait before running test
  -z string
    	Read requests from a file

Below is A basic example which will use 10 workers to send 200,000 requests is as follows:

$ baton -u http://localhost:8080/test -c 10 -r 200000

Instead of the number of requests, you can specify the time (in seconds) during which the requests should be sent. Baton will wait for all the responses to be received before reporting the results.

Requests file

When specifying a file to load requests from (-z filename), the file should be of CSV format (RFC-4180)

<method>,<url>,[<body>],[<header-key>:<header-value>, ...]
...

You can have one or more headers at the end separated by ,

For example:

POST,http://localhost:8888,body,Accept: application/xml,Content-type: Secret
GET,http://localhost:8888,,,

Example Output:

====================== Results ======================
Total requests:                               1254155
Time taken to complete requests:        10.046739294s
Requests per second:                           124832
Max response time (ms):                           440
Min response time (ms):                            55
Avg response time (ms):                        156.70
===================== Breakdown =====================
Number of connection errors:                        0
Number of 1xx responses:                            0
Number of 2xx responses:                      1254155
Number of 3xx responses:                            0
Number of 4xx responses:                            0
Number of 5xx responses:                            0
=====================================================

Features which are on the horizon...

  • Dynamic generation of data based on a template
  • Testing REST endpoints with dynamically generated keys

Caveats

  • Statistics are only provided when a fixed number of requests is provided (instead of providing a duration).

Dependency Management

Dep is currently being utilized as the dependency manager for Baton. Details of how to use dep can be found on https://golang.github.io/dep/.

Before updating any dependencies, ensure you have fully tested all functionality.

Contributing

We welcome Your interest in the American Express Open Source Community on Github. Any Contributor to any Open Source Project managed by the American Express Open Source Community must accept and sign an Agreement indicating agreement to the terms below. Except for the rights granted in this Agreement to American Express and to recipients of software distributed by American Express, You reserve all right, title, and interest, if any, in and to Your Contributions. Please fill out the Agreement.

Please feel free to open pull requests and see CONTRIBUTING.md for commit formatting details.

License

Any contributions made under this project will be governed by the Apache License 2.0.

Code of Conduct

This project adheres to the American Express Community Guidelines. By participating, you are expected to honor these guidelines.

baton's People

Contributors

madflojo avatar philegli avatar mchak3 avatar

Watchers

James Cloos 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.