Giter Club home page Giter Club logo

dummkopf's Introduction

Dummkopf

A stupid HTTP test server.

Features

  • Dynamic responses on any path (except /metrics).

The following query string parameters are supported:

Parameter Description Example
delay Delays the response. CSV list of duration:percent. delay=100us:10,50ms:50,0.5s:5
status Status code to return instead of 200. CSV list of code:percent. status=410:5,500:20
  • /metrics returns Prometheus metrics.

In addition to the default Prometheus metrics, the following additional metrics are returned:

Metric Description
http_requests_total Total number of HTTP requests processed, partitioned by status code.
http_request_duration_seconds HTTP request duration distribution.

Getting Started

Requires Go 1.13+ and Go module support.

Build and run:

$ make
$ ./dummkopf

Get help:

$ ./dummkopf -help

Example Requests

Return a 200 status with no delay:

$ curl localhost:9000

Return a 502 status with a 50 ms delay:

$ curl 'localhost:9000/?status=502:100&delay=50ms:100'

Return a 200 status 75% of the time and a 502 status 25% of the time, with an 80% chance of a 25 ms delay and a 20% chance of a 200 ms delay:

$ curl 'localhost:9000/?status=502:25&delay=25ms:80,200ms:20'

Beat it up!

$ fortio load -n 1000 -qps 0 -c 10 -allow-initial-errors -jitter 'localhost:9000/?status=401:3,500:10&delay=50ms:50,100ms:25,250ms:10,0.5s:10,1s:5'

Return Prometheus metrics:

$ curl localhost:9000/metrics

dummkopf's People

Contributors

garlandkr avatar

Watchers

 avatar  avatar  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.