1.2 KiB
1.2 KiB
agentx-loadtest-lunchandlearn
An API which simulates loaded responses to demonstrate load testing.
Getting Started
Some notes:
- A rate limit is initialized to a default of 10 concurrent requests.
- You may change this limit by making a
POSTtohttp://localhost:8080/limitwith the following payload:
{"limit":10}
- When the rate limit is reached requests will be made to wait until others finish.
- Additionally, when the rate limit is exceeded faults will be injected into the system. The proportion of failed responses you can expect is based on the following formula:
PercFailedResponses = NumberRequestsOverLimit / Limit
Spec
GET http://localhost:8080/data- A basic response body and 200 OK will be returned. The response time will be random under 1 second.
POST http://localhost:8080/click- Will return 204 No Content. The response time will be random under 100 milliseconds.
POST http://localhost:8080/limit- Change the limit for allowed concurrent requests. The default is 10.
Usage
Run from the /cmd/api directory:
go run *.go
You may also use the docker-compose.yml to spin up a container if you do not have Go installed:
docker-compose up