Skip to content

Commit cdee020

Browse files
author
rhamlett_microsoft
committed
Update load test to include GET option and update documentation.
1 parent 6a43e5e commit cdee020

3 files changed

Lines changed: 55 additions & 11 deletions

File tree

src/PerfProblemSimulator/Controllers/LoadTestController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public LoadTestController(
203203
/// <response code="200">Load test completed successfully with timing details.</response>
204204
/// <response code="500">Request exceeded 120s and random exception was triggered.</response>
205205
[HttpPost]
206+
[HttpGet]
206207
[ProducesResponseType(typeof(LoadTestResult), StatusCodes.Status200OK)]
207208
[ProducesResponseType(typeof(ErrorResponse), StatusCodes.Status500InternalServerError)]
208209
public async Task<IActionResult> ExecuteLoadTest(

src/PerfProblemSimulator/wwwroot/azure-monitoring-guide.html

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -871,19 +871,42 @@ <h3>Load Test Endpoint</h3>
871871
<h3>Setting Up Azure Load Testing</h3>
872872
<ol>
873873
<li>In the Azure Portal, create an <strong>Azure Load Testing</strong> resource</li>
874-
<li>Create a new test and configure the target URL:
875-
<div class="code-block">
874+
<li>Create a new test and configure the target URL using one of these options:</li>
875+
</ol>
876+
877+
<h4>Option 1: GET with Query Parameters (Simplest)</h4>
878+
<p>Use this for URL-based quick tests — no JMeter script required:</p>
879+
<div class="code-block">
880+
<span class="comment"># With defaults</span>
881+
https://your-app.azurewebsites.net/api/loadtest/probe
882+
883+
<span class="comment"># Faster degradation (recommended for testing)</span>
884+
https://your-app.azurewebsites.net/api/loadtest/probe?softLimit=25&amp;degradationFactor=10
885+
886+
<span class="comment"># Aggressive timeout testing</span>
887+
https://your-app.azurewebsites.net/api/loadtest/probe?softLimit=10&amp;degradationFactor=50
888+
</div>
889+
<p><strong>Query Parameters:</strong></p>
890+
<ul>
891+
<li><code>workIterations</code> - CPU work iterations (default: 1000)</li>
892+
<li><code>bufferSizeKb</code> - Memory buffer in KB (default: 5)</li>
893+
<li><code>softLimit</code> - Concurrent requests before degradation (default: 50)</li>
894+
<li><code>degradationFactor</code> - Delay ms per request over limit (default: 5)</li>
895+
</ul>
896+
897+
<h4>Option 2: POST with JSON Body</h4>
898+
<p>Use this when configuring a request body in Azure Load Testing or using a JMeter script:</p>
899+
<div class="code-block">
876900
POST https://your-app.azurewebsites.net/api/loadtest
877901
Content-Type: application/json
878902

879903
{
880-
"workIterations": 1000,
881-
"bufferSizeKb": 5,
882-
"softLimit": 50,
883-
"degradationFactor": 5
904+
"softLimit": 25,
905+
"degradationFactor": 10
884906
}
885-
</div>
886-
</li>
907+
</div>
908+
909+
<ol start="3">
887910
<li>Configure load pattern (ramp up, steady state, ramp down)</li>
888911
<li>Set up Azure Monitor integration to correlate metrics</li>
889912
</ol>

src/PerfProblemSimulator/wwwroot/documentation.html

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ <h3>Load Test Endpoint (Azure Load Testing)</h3>
879879
<tbody>
880880
<tr>
881881
<td><code>/api/loadtest</code></td>
882-
<td><span class="method-badge method-post">POST</span></td>
883-
<td>Execute load test probe with JSON body</td>
882+
<td><span class="method-badge method-get">GET</span> <span class="method-badge method-post">POST</span></td>
883+
<td>Execute load test probe (GET uses defaults, POST accepts JSON body)</td>
884884
</tr>
885885
<tr>
886886
<td><code>/api/loadtest/probe</code></td>
@@ -894,7 +894,22 @@ <h3>Load Test Endpoint (Azure Load Testing)</h3>
894894
</tr>
895895
</tbody>
896896
</table>
897-
<p><strong>Request body (POST):</strong></p>
897+
898+
<h4>Option 1: GET with Query Parameters (Recommended for Azure Load Testing)</h4>
899+
<p>Use for URL-based quick tests in Azure Load Testing:</p>
900+
<div class="code-block">
901+
<span class="comment"># With defaults (~100ms response at low load)</span>
902+
GET /api/loadtest/probe
903+
904+
<span class="comment"># Faster degradation (recommended for testing)</span>
905+
GET /api/loadtest/probe?softLimit=25&amp;degradationFactor=10
906+
907+
<span class="comment"># Aggressive timeout testing</span>
908+
GET /api/loadtest/probe?softLimit=10&amp;degradationFactor=50
909+
</div>
910+
911+
<h4>Option 2: POST with JSON Body</h4>
912+
<p>Use when you need a JMeter script or want to send a request body:</p>
898913
<div class="code-block">
899914
{
900915
<span class="string">"workIterations"</span>: 1000,
@@ -1015,6 +1030,7 @@ <h2>📐 Architecture</h2>
10151030
│ ├── <span class="file">CpuController.cs</span>
10161031
│ ├── <span class="file">CrashController.cs</span>
10171032
│ ├── <span class="file">HealthController.cs</span>
1033+
│ ├── <span class="file">LoadTestController.cs</span> <span class="comment"># Azure Load Testing endpoint</span>
10181034
│ ├── <span class="file">MemoryController.cs</span>
10191035
│ ├── <span class="file">MetricsController.cs</span>
10201036
│ ├── <span class="file">SlowRequestController.cs</span>
@@ -1024,6 +1040,7 @@ <h2>📐 Architecture</h2>
10241040
│ ├── <span class="file">CpuStressService.cs</span>
10251041
│ ├── <span class="file">CrashService.cs</span>
10261042
│ ├── <span class="file">LatencyProbeService.cs</span>
1043+
│ ├── <span class="file">LoadTestService.cs</span> <span class="comment"># Load test with soft limit degradation</span>
10271044
│ ├── <span class="file">MemoryPressureService.cs</span>
10281045
│ ├── <span class="file">MetricsBroadcastService.cs</span>
10291046
│ ├── <span class="file">MetricsCollector.cs</span>
@@ -1032,6 +1049,7 @@ <h2>📐 Architecture</h2>
10321049
│ ├── <span class="file">ThreadBlockService.cs</span>
10331050
│ ├── <span class="file">ICpuStressService.cs</span> <span class="comment"># Interfaces</span>
10341051
│ ├── <span class="file">ICrashService.cs</span>
1052+
│ ├── <span class="file">ILoadTestService.cs</span>
10351053
│ ├── <span class="file">IMemoryPressureService.cs</span>
10361054
│ ├── <span class="file">IMetricsCollector.cs</span>
10371055
│ ├── <span class="file">ISlowRequestService.cs</span>
@@ -1047,6 +1065,8 @@ <h2>📐 Architecture</h2>
10471065
│ ├── <span class="file">CrashRequest.cs</span>
10481066
│ ├── <span class="file">DetailedMetrics.cs</span>
10491067
│ ├── <span class="file">ErrorResponse.cs</span>
1068+
│ ├── <span class="file">LoadTestRequest.cs</span> <span class="comment"># Load test parameters</span>
1069+
│ ├── <span class="file">LoadTestResult.cs</span> <span class="comment"># Load test response</span>
10501070
│ ├── <span class="file">MemoryAllocationRequest.cs</span>
10511071
│ ├── <span class="file">MemoryReleaseResult.cs</span>
10521072
│ ├── <span class="file">MetricsSnapshot.cs</span>

0 commit comments

Comments
 (0)