Skip to content

Commit b464334

Browse files
author
rhamlett_microsoft
committed
Updated documentation link for diagnostic tools in documentation.html
1 parent aead0d7 commit b464334

File tree

2 files changed

+83
-9
lines changed

2 files changed

+83
-9
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,28 @@ The dashboard uses SignalR for real-time updates and includes controls to trigge
124124
| `/api/admin/reset-all` | POST | Release all memory and reset state |
125125
| `/api/admin/stats` | GET | Get current simulation statistics |
126126

127+
## ⏱️ Request Latency Monitor
128+
129+
The dashboard includes a **Request Latency Monitor** that demonstrates how thread pool starvation affects real-world request processing.
130+
131+
### How It Works
132+
133+
- A dedicated background thread (not from the thread pool) continuously probes `/api/health/probe`
134+
- Latency is measured end-to-end: request sent β†’ response received
135+
- Results are broadcast via SignalR to the dashboard in real-time
136+
137+
### What You'll Observe
138+
139+
| Scenario | Expected Latency | Explanation |
140+
|----------|-----------------|-------------|
141+
| Normal operation | < 50ms | Thread pool threads available |
142+
| Thread pool starvation | 100ms - 30s | Requests queued waiting for threads |
143+
| Timeout | 30s | No thread became available |
144+
145+
### Why This Matters
146+
147+
During thread pool starvation, CPU and memory metrics often look normal, but users experience severe latency. The latency monitor makes this invisible problem **visible** - you can watch response times spike from milliseconds to seconds when triggering the sync-over-async simulation.
148+
127149
## πŸ”§ Configuration
128150

129151
Configuration is managed through `appsettings.json`:
@@ -170,15 +192,15 @@ az webapp create \
170192
--name your-unique-app-name \
171193
--resource-group rg-perf-simulator \
172194
--plan asp-perf-simulator \
173-
--runtime "DOTNETCORE:8.0"
195+
--runtime "DOTNETCORE:10.0"
174196

175197
# Deploy
176198
cd src/PerfProblemSimulator
177199
dotnet publish -c Release
178200
az webapp deploy \
179201
--resource-group rg-perf-simulator \
180202
--name your-unique-app-name \
181-
--src-path bin/Release/net8.0/publish
203+
--src-path bin/Release/net10.0/publish
182204
```
183205

184206
### Safety Recommendation
@@ -204,7 +226,7 @@ This application is designed to work with Azure App Service diagnostics:
204226
4. **CPU Profiling** - Capture and analyze CPU traces
205227
5. **Memory Dumps** - Analyze memory allocations
206228

207-
See [azure-monitoring-guide.md](docs/azure-monitoring-guide.md) for detailed instructions.
229+
See [Azure Monitoring Guide](./docs/azure-monitoring-guide.md) for detailed instructions.
208230

209231
## πŸ“ Architecture
210232

β€Žsrc/PerfProblemSimulator/wwwroot/documentation.htmlβ€Ž

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ <h1>πŸ“š Documentation</h1>
283283
<li><a href="#overview">Overview</a></li>
284284
<li><a href="#quick-start">Quick Start</a></li>
285285
<li><a href="#dashboard">Dashboard</a></li>
286+
<li><a href="#latency">Latency Monitor</a></li>
286287
<li><a href="#api">API Reference</a></li>
287288
<li><a href="#configuration">Configuration</a></li>
288289
<li><a href="#azure">Azure Deployment</a></li>
@@ -379,11 +380,56 @@ <h2>πŸ“Š Dashboard</h2>
379380
<li><strong>CPU usage</strong> - Current processor utilization</li>
380381
<li><strong>Memory</strong> - Working set and GC heap sizes</li>
381382
<li><strong>Thread pool</strong> - Active threads and queue length</li>
383+
<li><strong>Request latency</strong> - Real-time probe response time (shows impact of thread pool starvation)</li>
382384
<li><strong>Active simulations</strong> - Currently running problem simulations</li>
383385
</ul>
384386
<p>The dashboard uses SignalR for real-time updates and includes controls to trigger each type of simulation.</p>
385387
</section>
386388

389+
<!-- Latency Monitor Section -->
390+
<section id="latency" class="doc-section">
391+
<h2>⏱️ Request Latency Monitor</h2>
392+
<p>The dashboard includes a <strong>Request Latency Monitor</strong> that demonstrates how thread pool starvation affects real-world request processing.</p>
393+
394+
<h3>How It Works</h3>
395+
<ul>
396+
<li>A dedicated background thread (not from the thread pool) continuously probes <code>/api/health/probe</code></li>
397+
<li>Latency is measured end-to-end: request sent β†’ response received</li>
398+
<li>Results are broadcast via SignalR to the dashboard in real-time</li>
399+
</ul>
400+
401+
<h3>What You'll Observe</h3>
402+
<table class="api-table">
403+
<thead>
404+
<tr>
405+
<th>Scenario</th>
406+
<th>Expected Latency</th>
407+
<th>Explanation</th>
408+
</tr>
409+
</thead>
410+
<tbody>
411+
<tr>
412+
<td>Normal operation</td>
413+
<td>&lt; 50ms</td>
414+
<td>Thread pool threads available</td>
415+
</tr>
416+
<tr>
417+
<td>Thread pool starvation</td>
418+
<td>100ms - 30s</td>
419+
<td>Requests queued waiting for threads</td>
420+
</tr>
421+
<tr>
422+
<td>Timeout</td>
423+
<td>30s</td>
424+
<td>No thread became available</td>
425+
</tr>
426+
</tbody>
427+
</table>
428+
429+
<h3>Why This Matters</h3>
430+
<p>During thread pool starvation, CPU and memory metrics often look normal, but users experience severe latency. The latency monitor makes this invisible problem <strong>visible</strong> β€” you can watch response times spike from milliseconds to seconds when triggering the sync-over-async simulation.</p>
431+
</section>
432+
387433
<!-- API Reference Section -->
388434
<section id="api" class="doc-section">
389435
<h2>πŸ”Œ API Reference</h2>
@@ -408,6 +454,11 @@ <h3>Health & Monitoring</h3>
408454
<td><span class="method-badge method-get">GET</span></td>
409455
<td>Detailed health with active simulations</td>
410456
</tr>
457+
<tr>
458+
<td><code>/api/health/probe</code></td>
459+
<td><span class="method-badge method-get">GET</span></td>
460+
<td>Lightweight probe for latency measurement</td>
461+
</tr>
411462
<tr>
412463
<td><code>/api/metrics/current</code></td>
413464
<td><span class="method-badge method-get">GET</span></td>
@@ -475,7 +526,7 @@ <h3>Memory Pressure Simulation</h3>
475526
<p><strong>Request body (allocate):</strong></p>
476527
<div class="code-block">
477528
{
478-
<span class="string">"sizeInMegabytes"</span>: 100
529+
<span class="string">"sizeMegabytes"</span>: 100
479530
}
480531
</div>
481532

@@ -588,15 +639,15 @@ <h3>Using Azure CLI</h3>
588639
--name your-unique-app-name \
589640
--resource-group rg-perf-simulator \
590641
--plan asp-perf-simulator \
591-
--runtime <span class="string">"DOTNETCORE:8.0"</span>
642+
--runtime <span class="string">"DOTNETCORE:10.0"</span>
592643

593644
<span class="comment"># Deploy</span>
594645
cd src/PerfProblemSimulator
595646
dotnet publish -c Release
596647
az webapp deploy \
597648
--resource-group rg-perf-simulator \
598649
--name your-unique-app-name \
599-
--src-path bin/Release/net8.0/publish
650+
--src-path bin/Release/net10.0/publish
600651
</div>
601652

602653
<h3>Safety Recommendation</h3>
@@ -616,7 +667,7 @@ <h3>Recommended Diagnostic Tools</h3>
616667
<li><strong>CPU Profiling</strong> - Capture and analyze CPU traces</li>
617668
<li><strong>Memory Dumps</strong> - Analyze memory allocations</li>
618669
</ul>
619-
<p>See <a href="docs/azure-monitoring-guide.md">azure-monitoring-guide.md</a> for detailed instructions.</p>
670+
<p>See the <a href="https://github.com/rhamlett-mms/NETCoreApp/blob/main/docs/azure-monitoring-guide.md">Azure Monitoring Guide</a> for detailed instructions.</p>
620671
</section>
621672

622673
<!-- Architecture Section -->
@@ -637,7 +688,8 @@ <h2>πŸ“ Architecture</h2>
637688
β”‚ β”œβ”€β”€ <span class="file">ThreadBlockService.cs</span>
638689
β”‚ β”œβ”€β”€ <span class="file">SimulationTracker.cs</span>
639690
β”‚ β”œβ”€β”€ <span class="file">MetricsCollector.cs</span>
640-
β”‚ └── <span class="file">MetricsBroadcastService.cs</span>
691+
β”‚ β”œβ”€β”€ <span class="file">MetricsBroadcastService.cs</span>
692+
β”‚ └── <span class="file">LatencyProbeService.cs</span>
641693
β”œβ”€β”€ <span class="folder">Hubs/</span> <span class="comment"># SignalR for real-time updates</span>
642694
β”‚ └── <span class="file">MetricsHub.cs</span>
643695
β”œβ”€β”€ <span class="folder">Models/</span> <span class="comment"># Data transfer objects</span>
@@ -678,7 +730,7 @@ <h3>Contributing</h3>
678730
<!-- Footer -->
679731
<footer style="text-align: center; padding: 2rem; color: var(--color-text-muted);">
680732
<p>Performance Problem Simulator - Educational Tool for Azure App Service Diagnostics</p>
681-
<p>Built with .NET 8.0 and ASP.NET Core | <a href="/">Return to Dashboard</a></p>
733+
<p>Built with .NET 10.0 and ASP.NET Core | <a href="/">Return to Dashboard</a></p>
682734
</footer>
683735
</div>
684736
</body>

0 commit comments

Comments
Β (0)