Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indiependente/srs
Slow Request Simulator
https://github.com/indiependente/srs
Last synced: 5 days ago
JSON representation
Slow Request Simulator
- Host: GitHub
- URL: https://github.com/indiependente/srs
- Owner: indiependente
- License: mit
- Created: 2020-10-01T15:19:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-01T16:50:32.000Z (over 4 years ago)
- Last Synced: 2024-05-02T05:17:02.628Z (8 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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````bash
./srs nn must be an integer representing the number of seconds before the server times out
```## Client
`curl localhost:8090/hello\?t=6````bash
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)
```bash
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 GMTall good
```- Sad path (request takes longer than timeout allows)
```bash
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: nosniffcontext deadline exceeded
```