Skip to content

Commit 51e3aad

Browse files
committed
documentation updates
1 parent fafa8d8 commit 51e3aad

4 files changed

Lines changed: 97 additions & 172 deletions

File tree

README.md

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,58 @@ Configuration is managed through `appsettings.json`:
261261

262262
### Environment Variables
263263

264+
The following environment variables can be configured to customize application behavior. These are optional and primarily useful when deploying to Azure App Service.
265+
264266
| Variable | Description | Default |
265267
|----------|-------------|---------|
266-
| `DISABLE_PROBLEM_ENDPOINTS` | Set to `true` to disable all problem-triggering endpoints | `false` |
268+
269+
| `IDLE_TIMEOUT_MINUTES` | Minutes of inactivity before suspending health probes. Reduces network traffic and Application Insights telemetry when idle. | `20` |
270+
| `PAGE_FOOTER` | Custom HTML footer text displayed at the bottom of the dashboard. Supports HTML links for attribution. | (empty) |
271+
272+
#### IDLE_TIMEOUT_MINUTES
273+
274+
When the application is idle (no dashboard connections or load test requests), health probes are automatically suspended to reduce unnecessary network traffic to Azure's frontend, AppLens, and Application Insights.
275+
276+
- **Default:** 20 minutes
277+
- **Wake-up:** Simply reload the dashboard or send any request
278+
- **Activity sources:** Dashboard connections, load test requests
279+
280+
**Setting via Azure CLI:**
281+
```bash
282+
az webapp config appsettings set \
283+
--resource-group rg-perf-simulator \
284+
--name your-app-name \
285+
--settings IDLE_TIMEOUT_MINUTES=30
286+
```
287+
288+
#### PAGE_FOOTER
289+
290+
The `PAGE_FOOTER` environment variable allows you to customize the footer credits displayed on the dashboard. This is useful for attributing tools, teams, or linking to relevant resources.
291+
292+
**Example Value:**
293+
```
294+
Created by <a href="https://speckit.org/" target="_blank">SpecKit</a> and <a href="https://github.com/copilot" target="_blank">Github Copilot</a>
295+
```
296+
297+
**Setting via Azure CLI:**
298+
```bash
299+
az webapp config appsettings set \
300+
--resource-group rg-perf-simulator \
301+
--name your-app-name \
302+
--settings PAGE_FOOTER='Created by <a href="https://speckit.org/" target="_blank">SpecKit</a> and <a href="https://github.com/copilot" target="_blank">Github Copilot</a>'
303+
```
304+
305+
**Setting Locally (PowerShell):**
306+
```powershell
307+
$env:PAGE_FOOTER = 'Created by <a href="https://speckit.org/" target="_blank">SpecKit</a> and <a href="https://github.com/copilot" target="_blank">Github Copilot</a>'
308+
```
309+
310+
**Setting Locally (Bash):**
311+
```bash
312+
export PAGE_FOOTER='Created by <a href="https://speckit.org/" target="_blank">SpecKit</a> and <a href="https://github.com/copilot" target="_blank">Github Copilot</a>'
313+
```
314+
315+
The footer is retrieved via the `/api/config/footer` endpoint and rendered in the dashboard's footer section. If `PAGE_FOOTER` is not set, the footer credits section is hidden.
267316

268317
## ☁️ Azure Deployment
269318

@@ -299,17 +348,6 @@ az webapp deploy \
299348
--src-path bin/Release/net10.0/publish
300349
```
301350

302-
### Safety Recommendation
303-
304-
After deployment, consider disabling problem endpoints:
305-
306-
```bash
307-
az webapp config appsettings set \
308-
--resource-group rg-perf-simulator \
309-
--name your-unique-app-name \
310-
--settings DISABLE_PROBLEM_ENDPOINTS=true
311-
```
312-
313351
## 🔍 Using Azure Diagnostics
314352

315353
This application is designed to work with Azure App Service diagnostics:
@@ -353,8 +391,6 @@ src/PerfProblemSimulator/
353391
│ ├── MetricsHub.cs
354392
│ └── IMetricsClient.cs
355393
├── Models/ # Data transfer objects
356-
├── Middleware/ # Request pipeline
357-
│ └── ProblemEndpointGuard.cs
358394
└── wwwroot/ # SPA dashboard
359395
├── index.html
360396
├── documentation.html

src/PerfProblemSimulator/Middleware/ProblemEndpointGuard.cs

Lines changed: 0 additions & 139 deletions
This file was deleted.

src/PerfProblemSimulator/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using PerfProblemSimulator.Hubs;
2-
using PerfProblemSimulator.Middleware;
32
using PerfProblemSimulator.Models;
43
using PerfProblemSimulator.Services;
54

@@ -55,7 +54,6 @@
5554
// - Services/*Service.cs: Business logic implementations
5655
// - Controllers/*Controller.cs: HTTP endpoint handlers
5756
// - Hubs/MetricsHub.cs: WebSocket real-time communication
58-
// - Middleware/ProblemEndpointGuard.cs: Kill switch middleware
5957
// - Models/ProblemSimulatorOptions.cs: Configuration binding
6058
// =============================================================================
6159

@@ -301,11 +299,6 @@
301299
app.UseDefaultFiles(); // Enables default document (index.html)
302300
app.UseStaticFiles();
303301

304-
// Problem endpoint guard - blocks trigger/allocate/release endpoints when disabled
305-
// Educational Note: This middleware demonstrates the "kill switch" pattern for
306-
// safely deploying code that has potentially dangerous functionality.
307-
app.UseProblemEndpointGuard();
308-
309302
// HTTPS redirection (commented out for local development convenience)
310303
// app.UseHttpsRedirection();
311304

src/PerfProblemSimulator/wwwroot/documentation.html

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ <h2>🔧 Configuration</h2>
10601060
<p><strong>Note:</strong> This application is designed to be fully breakable for educational purposes. There are no safety limits on resource consumption — simulations can run until the application crashes or resources are exhausted.</p>
10611061

10621062
<h3>Environment Variables</h3>
1063+
<p>The following environment variables can be configured to customize application behavior. These are optional and primarily useful when deploying to Azure App Service.</p>
10631064
<table class="config-table">
10641065
<thead>
10651066
<tr>
@@ -1070,12 +1071,55 @@ <h3>Environment Variables</h3>
10701071
</thead>
10711072
<tbody>
10721073
<tr>
1073-
<td><code>DISABLE_PROBLEM_ENDPOINTS</code></td>
1074-
<td>Set to <code>true</code> to disable all problem-triggering endpoints</td>
1075-
<td><code>false</code></td>
1074+
<td><code>IDLE_TIMEOUT_MINUTES</code></td>
1075+
<td>Minutes of inactivity before suspending health probes. Reduces network traffic and Application Insights telemetry when idle.</td>
1076+
<td><code>20</code></td>
1077+
</tr>
1078+
<tr>
1079+
<td><code>PAGE_FOOTER</code></td>
1080+
<td>Custom HTML footer text displayed at the bottom of the dashboard. Supports HTML links for attribution.</td>
1081+
<td>(empty)</td>
10761082
</tr>
10771083
</tbody>
10781084
</table>
1085+
1086+
<h4>IDLE_TIMEOUT_MINUTES</h4>
1087+
<p>When the application is idle (no dashboard connections or load test requests), health probes are automatically suspended to reduce unnecessary network traffic to Azure's frontend, AppLens, and Application Insights.</p>
1088+
<ul>
1089+
<li><strong>Default:</strong> 20 minutes</li>
1090+
<li><strong>Wake-up:</strong> Simply reload the dashboard or send any request</li>
1091+
<li><strong>Activity sources:</strong> Dashboard connections, load test requests</li>
1092+
</ul>
1093+
<p><strong>Setting via Azure CLI:</strong></p>
1094+
<div class="code-block">
1095+
az webapp config appsettings set \
1096+
--resource-group rg-perf-simulator \
1097+
--name your-app-name \
1098+
--settings IDLE_TIMEOUT_MINUTES=<span class="string">30</span>
1099+
</div>
1100+
1101+
<h4>PAGE_FOOTER</h4>
1102+
<p>The <code>PAGE_FOOTER</code> environment variable allows you to customize the footer credits displayed on the dashboard. This is useful for attributing tools, teams, or linking to relevant resources.</p>
1103+
<p><strong>Example Value:</strong></p>
1104+
<div class="code-block">
1105+
Created by &lt;a href="https://speckit.org/" target="_blank"&gt;SpecKit&lt;/a&gt; and &lt;a href="https://github.com/copilot" target="_blank"&gt;Github Copilot&lt;/a&gt;
1106+
</div>
1107+
<p><strong>Setting via Azure CLI:</strong></p>
1108+
<div class="code-block">
1109+
az webapp config appsettings set \
1110+
--resource-group rg-perf-simulator \
1111+
--name your-app-name \
1112+
--settings PAGE_FOOTER=<span class="string">'Created by &lt;a href="https://speckit.org/" target="_blank"&gt;SpecKit&lt;/a&gt; and &lt;a href="https://github.com/copilot" target="_blank"&gt;Github Copilot&lt;/a&gt;'</span>
1113+
</div>
1114+
<p><strong>Setting Locally (PowerShell):</strong></p>
1115+
<div class="code-block">
1116+
$env:PAGE_FOOTER = <span class="string">'Created by &lt;a href="https://speckit.org/" target="_blank"&gt;SpecKit&lt;/a&gt; and &lt;a href="https://github.com/copilot" target="_blank"&gt;Github Copilot&lt;/a&gt;'</span>
1117+
</div>
1118+
<p><strong>Setting Locally (Bash):</strong></p>
1119+
<div class="code-block">
1120+
<span class="keyword">export</span> PAGE_FOOTER=<span class="string">'Created by &lt;a href="https://speckit.org/" target="_blank"&gt;SpecKit&lt;/a&gt; and &lt;a href="https://github.com/copilot" target="_blank"&gt;Github Copilot&lt;/a&gt;'</span>
1121+
</div>
1122+
<p>The footer is retrieved via the <code>/api/config/footer</code> endpoint and rendered in the dashboard's footer section. If <code>PAGE_FOOTER</code> is not set, the footer credits section is hidden.</p>
10791123
</section>
10801124

10811125
<!-- Azure Deployment Section -->
@@ -1113,15 +1157,6 @@ <h3>Using Azure CLI</h3>
11131157
--src-path bin/Release/net10.0/publish
11141158
</div>
11151159

1116-
<h3>Safety Recommendation</h3>
1117-
<p>After deployment, consider disabling problem endpoints:</p>
1118-
<div class="code-block">
1119-
az webapp config appsettings set \
1120-
--resource-group rg-perf-simulator \
1121-
--name your-unique-app-name \
1122-
--settings DISABLE_PROBLEM_ENDPOINTS=<span class="keyword">true</span>
1123-
</div>
1124-
11251160
<h3>Recommended Diagnostic Tools</h3>
11261161
<ul>
11271162
<li><strong>Diagnose and Solve Problems</strong> - App Service blade for automated diagnosis</li>

0 commit comments

Comments
 (0)