Skip to content

Commit 9566ace

Browse files
Address review feedback: fix PRESET flag, simplify devproxy commands, remove curl examples
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
1 parent c81749a commit 9566ace

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

samples/api-degradation-scenarios/README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Summary
44

5-
This sample contains presets to simulate various API degradation scenarios to test how your application handles partial failures, intermittent errors, rate limiting, and slow responses. Use these configurations to build apps that gracefully degrade under stress and verify that your error handling and retry logic works before production.
5+
This sample demonstrates how to simulate various API degradation scenarios to test how your application handles partial failures, intermittent errors, rate limiting, and slow responses. Use these configurations to build apps that gracefully degrade under stress and verify that your error handling and retry logic works before production.
66

77
![API Degradation Monitoring Dashboard](assets/screenshot.png)
88

@@ -57,13 +57,7 @@ You can also run Dev Proxy with specific configurations:
5757
This configuration combines all three degradation scenarios: intermittent 503 errors (30% of requests), rate limiting (10 requests per minute), and slow responses (3-5 seconds latency).
5858

5959
```bash
60-
devproxy --config-file .devproxy/devproxyrc.json
61-
```
62-
63-
Test with:
64-
65-
```bash
66-
curl -ikx http://127.0.0.1:8000 https://api.example.com/data
60+
devproxy
6761
```
6862

6963
### Intermittent 503 errors only
@@ -74,12 +68,6 @@ This configuration simulates random 503 Service Unavailable errors for 30% of re
7468
devproxy --config-file .devproxy/intermittent-errors.devproxyrc.json
7569
```
7670

77-
Test with:
78-
79-
```bash
80-
curl -ikx http://127.0.0.1:8000 https://api.example.com/data
81-
```
82-
8371
### Rate limiting only
8472

8573
This configuration simulates hitting rate limits with 429 Too Many Requests responses after 10 requests per minute.
@@ -88,12 +76,6 @@ This configuration simulates hitting rate limits with 429 Too Many Requests resp
8876
devproxy --config-file .devproxy/rate-limiting.devproxyrc.json
8977
```
9078

91-
Test with:
92-
93-
```bash
94-
curl -ikx http://127.0.0.1:8000 https://api.example.com/data
95-
```
96-
9779
### Slow responses only
9880

9981
This configuration adds random latency (3-5 seconds) to all responses.
@@ -102,12 +84,6 @@ This configuration adds random latency (3-5 seconds) to all responses.
10284
devproxy --config-file .devproxy/slow-responses.devproxyrc.json
10385
```
10486

105-
Test with:
106-
107-
```bash
108-
curl -ikx http://127.0.0.1:8000 https://api.example.com/data
109-
```
110-
11187
## Features
11288

11389
This sample demonstrates how to use Dev Proxy to simulate API degradation scenarios. Using this sample you can:

samples/api-degradation-scenarios/assets/sample.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"name": "pnp-devproxy-api-degradation-scenarios",
44
"source": "pnp",
55
"title": "Simulate API degradation scenarios",
6-
"shortDescription": "This sample contains presets to simulate various API degradation scenarios including intermittent errors, rate limiting, and slow responses to test your application's resilience.",
6+
"shortDescription": "This sample demonstrates how to simulate various API degradation scenarios including intermittent errors, rate limiting, and slow responses to test your application's resilience.",
77
"url": "https://github.com/pnp/proxy-samples/tree/main/samples/api-degradation-scenarios",
88
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/proxy-samples/tree/main/samples/api-degradation-scenarios",
99
"longDescription": [
10-
"This sample contains presets to simulate various API degradation scenarios including intermittent errors, rate limiting, and slow responses to test your application's resilience."
10+
"This sample demonstrates how to simulate various API degradation scenarios including intermittent errors, rate limiting, and slow responses to test your application's resilience."
1111
],
1212
"creationDateTime": "2026-01-10",
1313
"updateDateTime": "2026-01-10",
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"key": "PRESET",
24-
"value": "Yes"
24+
"value": "No"
2525
},
2626
{
2727
"key": "MOCKS",

samples/api-degradation-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Demo web app to test API degradation scenarios with Dev Proxy",
55
"main": "index.html",
66
"scripts": {
7-
"start": "npx concurrently \"npx http-server -p 3000\" \"devproxy --config-file .devproxy/devproxyrc.json\""
7+
"start": "npx concurrently \"npx http-server -p 3000\" \"devproxy\""
88
},
99
"keywords": [
1010
"dev-proxy",

0 commit comments

Comments
 (0)