You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,9 @@ This application is designed to help developers and DevOps engineers:
18
18
- 🔥 **CPU stress** - Creates dedicated threads running spin loops to consume all CPU cores
19
19
- 📊 **Memory pressure** - Allocates and pins memory blocks to increase working set
20
20
- 🧵 **Thread pool starvation** - Uses sync-over-async anti-patterns to block thread pool threads
21
-
- � **Slow requests** - Generates long-running requests with sync-over-async patterns for CLR Profiler analysis
22
-
- �💥 **Application crashes** - Triggers fatal crashes for testing Azure Crash Monitoring and memory dumps
21
+
- 🐢 **Slow requests** - Generates long-running requests with sync-over-async patterns for CLR Profiler analysis
22
+
- 💥 **Application crashes** - Triggers fatal crashes for testing Azure Crash Monitoring and memory dumps
23
+
- ❌ **Failed requests** - Generates HTTP 5xx errors visible in AppLens and Application Insights
23
24
24
25
**Only deploy this application in isolated, non-production environments.**
25
26
@@ -160,6 +161,25 @@ The slow request simulator generates requests using three different sync-over-as
160
161
-**NestedSyncOverAsync**: Sync methods that block internally - look for `*_BLOCKS_INTERNALLY` methods
161
162
-**DatabasePattern**: Simulated database/HTTP blocking - look for `*Sync_SYNC_BLOCK` methods
162
163
164
+
### Failed Request Simulation
165
+
166
+
| Endpoint | Method | Description |
167
+
|----------|--------|-------------|
168
+
|`/api/failedrequest/start`| POST | Start generating HTTP 500 errors |
169
+
|`/api/failedrequest/stop`| POST | Stop the simulation |
170
+
|`/api/failedrequest/status`| GET | Get current simulation status |
171
+
172
+
**Request body (start):**
173
+
```json
174
+
{
175
+
"requestCount": 10
176
+
}
177
+
```
178
+
179
+
-`requestCount`: Number of HTTP 500 errors to generate (default: 10)
180
+
181
+
Each failed request throws a random exception type (NullReferenceException, TimeoutException, InvalidOperationException, etc.) visible in AppLens and Application Insights.
Copy file name to clipboardExpand all lines: specs/001-perf-problem-simulator/spec.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,26 @@ As a learner, I want a simple web dashboard showing the current state of the app
89
89
90
90
---
91
91
92
+
### User Story 5 - Generate Failed Requests for AppLens Analysis (Priority: P2)
93
+
94
+
As a developer or support engineer, I want to generate HTTP 5xx errors so that I can observe how failed requests appear in AppLens and Application Insights, and practice diagnosing application failures.
95
+
96
+
**Why this priority**: HTTP 500 errors are one of the most common issues investigated through Azure diagnostics. Understanding how failures appear in AppLens and Application Insights is essential for effective production troubleshooting.
97
+
98
+
**Independent Test**: Can be tested by invoking the failed request endpoint and observing errors appear in AppLens (Azure Portal → Diagnose and Solve Problems) and the Application Insights Failures blade.
99
+
100
+
**Acceptance Scenarios**:
101
+
102
+
1.**Given** the application is running normally, **When** I invoke the failed request endpoint with a count of 10, **Then** 10 HTTP 500 errors are generated and logged.
103
+
104
+
2.**Given** I am monitoring Application Insights, **When** I trigger failed requests, **Then** the errors appear in the Failures blade within 2-3 minutes with detailed exception information.
105
+
106
+
3.**Given** I am viewing the dashboard, **When** failed requests are generated, **Then** each failure appears in the Event Log with the specific exception type (e.g., NullReferenceException, TimeoutException) displayed in hot pink.
107
+
108
+
4.**Given** I have deployed to Azure App Service, **When** I generate failed requests, **Then** the errors are visible in AppLens diagnostics for incident analysis practice.
109
+
110
+
---
111
+
92
112
### Edge Cases
93
113
94
114
- What happens when a user requests more memory than available? The application should cap allocation at a safe maximum and report the limitation rather than crashing.
@@ -107,6 +127,7 @@ As a learner, I want a simple web dashboard showing the current state of the app
107
127
-**FR-003**: System MUST provide an endpoint to release previously allocated memory
108
128
-**FR-004**: System MUST provide an endpoint that demonstrates sync-over-async thread blocking with configurable concurrency and delay parameters
109
129
-**FR-005**: System MUST allow multiple problem types to be active simultaneously
130
+
-**FR-018**: System MUST provide an endpoint to generate HTTP 5xx errors with configurable count, using random exception types visible in AppLens and Application Insights
Copy file name to clipboardExpand all lines: src/PerfProblemSimulator/wwwroot/azure-monitoring-guide.html
+94Lines changed: 94 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -968,6 +968,97 @@ <h4>Downloading the Dump File</h4>
968
968
</ol>
969
969
</section>
970
970
971
+
<!-- Diagnosing Failed Requests Section -->
972
+
<sectionid="failedrequests" class="doc-section">
973
+
<h2>❌ Diagnosing Failed Requests (HTTP 5xx)</h2>
974
+
<p>HTTP 500 errors are one of the most common issues that impact application availability. This simulation generates random exceptions to practice diagnosing failed requests in Azure.</p>
975
+
976
+
<h3>What to Simulate</h3>
977
+
<ol>
978
+
<li>In the dashboard, click <strong>❌ Start Failed Requests</strong></li>
979
+
<li>Wait for requests to complete (each takes ~1.5 seconds)</li>
980
+
<li>Observe exception types in the Event Log (hot pink entries)</li>
981
+
</ol>
982
+
983
+
<h3>Diagnosing with AppLens</h3>
984
+
<ol>
985
+
<li>In Azure Portal, go to your App Service</li>
986
+
<li>Navigate to <strong>Diagnose and solve problems</strong></li>
987
+
<li>Search for <strong>"Application Errors"</strong> or <strong>"HTTP 500"</strong></li>
988
+
<li>AppLens will show:
989
+
<ul>
990
+
<li>Error rate over time</li>
991
+
<li>Most common exception types</li>
992
+
<li>Stack traces for each failure</li>
993
+
<li>Correlation with other symptoms</li>
994
+
</ul>
995
+
</li>
996
+
</ol>
997
+
998
+
<h3>Diagnosing with Application Insights</h3>
999
+
<ol>
1000
+
<li>In Azure Portal, go to your Application Insights resource</li>
1001
+
<li>Click <strong>Failures</strong> in the left menu</li>
1002
+
<li>Review the failures timeline and exception breakdown</li>
0 commit comments