srs

command module
v0.0.0-...-963752e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 9 Imported by: 0

README

Slow Request Simulator (SRS)

SRS is a simple Go program that simulates a timeout bounded HTTP server where execution time of each request can be set using a url query param.

Server

./srs 5

    ./srs n

        n must be an integer representing the number of seconds before the server times out

Client

curl localhost:8090/hello\?t=6

    curl localhost:8090/hello\?t=6
    
        t must be an integer representing the number of seconds the request will take to complete

Example using http CLI

  • Happy path (request takes less or as much as timeout allows)
http :8090/hello\?t=5
HTTP/1.1 200 OK
Content-Length: 9
Content-Type: text/plain; charset=utf-8
Date: Thu, 01 Oct 2020 14:55:36 GMT

all good
  • Sad path (request takes longer than timeout allows)
http :8090/hello\?t=6
HTTP/1.1 500 Internal Server Error
Content-Length: 26
Content-Type: text/plain; charset=utf-8
Date: Thu, 01 Oct 2020 15:03:32 GMT
X-Content-Type-Options: nosniff

context deadline exceeded

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL