add toxic-proxy.sh and docs#1306
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughIntroduces a new toxic proxy setup for development to simulate degraded network conditions. Adds an environment variable, a Bash script that configures and runs Toxiproxy with specific network toxics (bandwidth limits, latency, jitter, connection resets), and documentation explaining the usage workflow. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Glorious |
This guide explains how to use the staged toxic proxy setup to simulate poor network conditions when developing Open Data Capture.
When you run
scripts/toxic-proxy.sh, it configures Toxiproxy with the following simulated network conditions:Together, these toxics approximate a slow, unstable network where responses arrive slowly, some requests suffer extra delay, and a minority of connections fail unexpectedly.
Prerequisites
toxiproxy-serverandtoxiproxy-cli) and ensure they are available on yourPATH.Steps
Set the toxic proxy port in
.envChoose a port for the toxic proxy (for example
5501) and set:API_DEV_TOXIC_PROXY_PORT=5501Point the frontend at the toxic proxy
Update
API_BASE_URLto use the same port on localhost:API_BASE_URL=http://localhost:5501/Start the toxic proxy
Run:
Leave this running. It creates a proxy that sits between the frontend and the API server and applies bandwidth limits.
Launch the app as normal
In another terminal, run:
Notes
API_DEV_SERVER_PORTfrom.envto know where your API server is listening.API_DEV_TOXIC_PROXY_PORTis empty, the script exits without starting the proxy.Summary by CodeRabbit
New Features
Documentation