Giter VIP home page Giter VIP logo

vegeta-server's Introduction

GoDoc Go Report Card Build Status License Coverage Status

Vegeta Server - A RESTful load-testing service

A RESTful API server for vegeta, a load testing tool written in Go.

Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. The vegeta library is written in Go, which makes it ideal to implement server in Go.

The REST API model enables users to, asynchronously, submit multiple attacks targeting the same (or varied) endpoints, lookup pending or historical reports and update/cancel/re-submit attacks, using a simple RESTful API.

Getting Started

Installing

make all

NOTE: make all resolves all the dependencies, formats the code using gofmt, validates and lints using golangci-lint and golint, builds the vegeta-server binary and drops it in the /bin directory and finally runs tests using go test.

Quick Start

Start the server using the vegeta-server binary generated after the previous step.

Usage: main [<flags>]

Flags:
      --help            Show context-sensitive help (also try --help-long and --help-man).
      --ip="0.0.0.0"  Server IP Address.
      --port="80"     Server Port.
  -v, --version         Version Info
      --debug           Enabled Debug

Example

Serve HTTP traffic at 0.0.0.0:80/api/v1

./bin/vegeta-server --ip=0.0.0.0 --port=80 --debug

Try it out using make run

make run

INFO[0000] creating new dispatcher                       component=dispatcher
INFO[0000] starting dispatcher                           component=dispatcher
INFO[0000] listening                                     component=server ip=0.0.0.0 port=80

Using Docker

Build the docker image using local Dockerfile

docker build .

Run the docker container

docker run -d -p 8000:80 --name vegeta {container id}

You can also build and run a docker container using make

make container_run

NOTE: make container and make container_clean can be used to build the Dockerfile and delete the container and image.

Running tests

make test

Documentation

Contributing

Link to CONTRIBUTING.md

Project Structure

  • /: Extraneous setup and configuration files. No go code exists at this level.
  • /cmd/server: Comprises of package main serving as an entry point to the code.
  • /models: Includes the model definitions used by the DB and the API endpoints.
    • /db.go: Provides the storage interface, which is implemented by the configured database.
  • /internal: Internal only packages used by the server to run attacks and serve reports.
    • /dispatcher: Defines and implements the dispatcher interface, with the primary responsibility to carry out concurrent attacks.
    • /reporter: Defines and implements the reporter interface, with the primary responsibility to generate reports from previously completed attacks, in supported formats (JSON/Text/Binary).
    • /endpoints: Responsible for defining and registering the REST API endpoint handlers.
  • /pkg/vegeta: Vegeta library specific, wrapper methods and definitions. (Keep these isolated from the internals of the server, to support more load-testing tools/libraries in the future.)
  • /scripts: Helper installation scripts.

Roadmap

Link to roadmap

License

Link to LICENSE

Support

Contact Author at [email protected]

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.