A production-ready System Under Test (SUT) for load testing and Root Cause Analysis (RCA) validation.
This is a deterministic mock API built with Cloudflare Pages + Functions designed for:
- โ Load testing with controlled behaviors
- โ RCA agent validation
- โ Browser performance metrics testing (LCP, INP, FCP, TTFB)
- โ Simulating real-world failure scenarios
/ (repo root)
โ
โโโ package.json
โโโ wrangler.toml
โโโ README.md
โโโ DEPLOYMENT.md
โ
โโโ /public
โ โโโ index.html # Main page with API call
โ โโโ large.html # LCP testing page
โ โโโ /assets
โ โโโ large-image.jpg # 1200x800 test image
โ
โโโ /functions
โโโ /api
โโโ [[route]].js # Catch-all API handler
The API supports query parameters for deterministic testing:
| Parameter | Type | Purpose | Example |
|---|---|---|---|
delay |
ms | Artificial latency | ?delay=3000 |
status |
HTTP code | Simulate HTTP errors | ?status=500 |
size |
integer | Payload size (KB) | ?size=500 |
errorType |
string | Semantic error type | ?errorType=db |
db- Database connection timeoutauth- Unauthorized access
curl https://your-site.pages.dev/api/testcurl https://your-site.pages.dev/api/test?delay=3000curl https://your-site.pages.dev/api/test?status=500curl https://your-site.pages.dev/api/test?status=500&errorType=dbcurl https://your-site.pages.dev/api/test?size=500curl https://your-site.pages.dev/api/test?delay=2000&status=503&errorType=db&size=100/api/test?delay=2000
/api/test?status=500
/api/test?status=401&errorType=auth
/api/test?size=1000
Generate traffic with:
- 70% success (200)
- 20% latency (delay=1000-3000ms)
- 10% errors (500)
- Measures LCP with single large image
- API call button for interaction testing
- Lightweight for baseline metrics
- Multiple large images for LCP regression
- Slow and fast API buttons
- Real-time duration display
npm install -g wranglerwrangler pages dev public --compatibility-date=2024-01-01Access at: http://localhost:8788
See DEPLOYMENT.md for complete deployment instructions.
Quick deploy to Cloudflare Pages:
- Push to GitHub
- Connect repo in Cloudflare Dashboard
- Set build output:
public - Deploy
| Behavior | Expected RCA |
|---|---|
delay โ |
Backend latency |
status=500 spike |
Infrastructure failure |
status=401 spike |
Functional auth issue |
| Large payload + LCP โ | Frontend regression |
Before load testing:
- Public URL accessible
- 200 response works
- 500 response works
-
delayparameter works -
sizeparameter works - Browser page loads correctly
- No caching (check headers)
- Images load properly
- โ Not a real backend
- โ No database required
- โ No authentication system
- โ No external dependencies
- โ No random behavior (deterministic only)
- Cloudflare Pages + Functions only
- No Node.js server
- No external APIs
- No database
- Free tier compatible
- Public URL
Potential additions:
- Random failure rate parameter
- CPU-intensive operations
- Memory load simulation
- Edge region routing
Private project for load testing purposes.
This is a controlled testing environment. Changes should maintain deterministic behavior.
Note: This SUT is designed for reliability and reproducibility in load testing scenarios.