benchttp / cobaye

Local HTTP server exposing configurable endpoints to be benchmarked for testing purposes.

Repository from Github https://github.combenchttp/cobayeRepository from Github https://github.combenchttp/cobaye

cobaye

Local HTTP server exposing configurable endpoints to be benchmarked for testing purposes.

Run

go run ./...

Note: default port is 9999. It can be overrided with flag -port:

go run ./... -port 80

CLI

Typing the command debug in the CLI while the server is running will output the count of received requests since it started.

Endpoints

The server exposes two endpoints:

  • GET /

    Response code: 200
    Response body: <empty>
    Optional query params:
    - `delay` (`time.Duration`): minimum duration before response
    - `fib` (`int`): nth element in fibonacci's suite to calculate before reponse
    
  • GET /debug

    Response code: 200
    Response body: <received requests count> (raw text)
    

Usage examples

  • http://localhost:9999?delay=250ms
  • http://localhost:9999?fib=40
  • http://localhost:9999?fib=40&delay=3s

About

Local HTTP server exposing configurable endpoints to be benchmarked for testing purposes.

License:Other


Languages

Language:Go 91.4%Language:Makefile 8.6%