Giter Club home page Giter Club logo

responder's Introduction

Responder

This is a very simple web-app which simply always returns HTTP status code 200. It will also wait for an amount of time which can be set in URL parameters.

It's intended use is as a simulated upstream when evaluating network components in distributed systems. My use case for example was to evaluate the performance profile and resource consumption of load balancers.

Parametrization

/static?delay=<delay in ms> e.g. /static?delay=25 /uniform?from=<from delay in ms>&to=<to delay in ms> e.g. /uniform?from=10&to=50 /lognorm?mean=<mean ms>&stdev=<standard deviation ms> e.g. /lognorm?mean=25&stdev=25

You can also always use those without parameters. In this case the following defaults are used:

/static time=25
/uniform from=10&to=30
/lognorm mean=25&stdev=10

CPU Consumption parameters

Per default the application just sleeps and does not consume any CPU. Following parameters can be used to busy wait and consume CPU during the duration.

/static?cores=<number of go routines> You can use these parameters with any random distribution.

The application will use 100% * cores CPU for the duration.

Request structure

Apart from the URL and POST request type, you can use any request you like, with any other parameters you like. Nothing will happen.

Response structure

Response will always be HTTP 200 OK, with a placeholder JSON response body:

{
  "first": 0.12345,
  "second": 0.12345,
  "third": 0.12345,
  "forth": 0.12345,
  "fifth": 0.12345,
  "sixth": 0.12345
}

Feel free the change this in code should your use case require something else.

Building

Generally you will build this just like you would any other go app. I won't explain how to build a go app here.

Docker

For debugging or simple local execution you can run the default Dockerfile in the root directory.

Depending on what your goals are you may need to build multi-arch docker images to make everything run on ARM systems as well. To this end use the convenience scripts like so scripts/docker-build-multiarch.sh <your version tag>.

To push you can use a script too: scripts/docker-push-all.sh <your version tag>.

Please note that in the scripts the image name is set as jjnp/responder. Feel free to change this to push images to whatever repository you need them in.

Hint: In case there are build errors with the ARM images you might need to run the following command first, as described here

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

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.