version: "3.3"
services:
toxiproxy:
image: "shopify/toxiproxy:latest"
ports:
- "8474:8474"
- "8080:8080"
httpbin:
image: "kennethreitz/httpbin:latest"
- Run testbed
docker-compose up
- Create service
docker-compose exec toxiproxy sh
cd /go/bin/
./toxiproxy-cli create httpbin-service -l 0.0.0.0:8080 -u httpbin:80
- Test service without toxics
salvo "http://127.0.0.1:8080" -c 10 -n 100
- Add some toxics
./toxiproxy-cli toxic add httpbin-service --type latency --toxicName httpbin-latency --attribute latency=1000 --attribute jitter=100 --toxicity=0.7
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
- Add some more toxics
./toxiproxy-cli toxic add httpbin-service --type limit_data --toxicName httpbin-limit-data --attribute bytes=500 --toxicity=0.7
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
- Add some more toxics
./toxiproxy-cli toxic add httpbin-service --type timeout --toxicName httpbin-timeout --attribute timeout=1 --toxicity=0.6
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
- Run testbed
docker-compose up
- Create service
docker-compose exec toxiproxy sh
cd /go/bin/
./toxiproxy-cli create httpbin-service -l 0.0.0.0:8080 -u httpbin:80
- Test service without toxics
salvo "http://127.0.0.1:8080" -c 10 -n 100
- Add some toxics
./toxiproxy-cli toxic add httpbin-service --type latency --toxicName httpbin-latency --attribute latency=1000 --attribute jitter=100 --toxicity=0.7
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
- Add some more toxics
./toxiproxy-cli toxic add httpbin-service --type limit_data --toxicName httpbin-limit-data --attribute bytes=500 --toxicity=0.7
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
- Add some more toxics
./toxiproxy-cli toxic add httpbin-service --type timeout --toxicName httpbin-timeout --attribute timeout=1 --toxicity=0.6
- Run a quick test using a simple load testing tool
salvo "http://127.0.0.1:8080/get" -c 10 -n 100
https://github.com/Shopify/toxiproxy#http-api
All endpoints are JSON.
- GET /proxies - List existing proxies and their toxics
- POST /proxies - Create a new proxy
- POST /populate - Create or replace a list of proxies
- GET /proxies/{proxy} - Show the proxy with all its active toxics
- POST /proxies/{proxy} - Update a proxy's fields
- DELETE /proxies/{proxy} - Delete an existing proxy
- GET /proxies/{proxy}/toxics - List active toxics
- POST /proxies/{proxy}/toxics - Create a new toxic
- GET /proxies/{proxy}/toxics/{toxic} - Get an active toxic's fields
- POST /proxies/{proxy}/toxics/{toxic} - Update an active toxic
- DELETE /proxies/{proxy}/toxics/{toxic} - Remove an active toxic
- POST /reset - Enable all proxies and remove all active toxics
- GET /version - Returns the server version number