Skip to content

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

License

Notifications You must be signed in to change notification settings

benchttp/cobaye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published