Skip to content

Commit f439953

Browse files
committed
Add improvements to YAML file
1 parent 40e3414 commit f439953

File tree

1 file changed

+136
-8
lines changed

1 file changed

+136
-8
lines changed

articles/load-testing/reference-test-config-yaml.md

Lines changed: 136 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ A load test configuration uses the following keys:
3838
| `secrets` | object | N | | List of secrets that the Apache JMeter or Locust script references. See [secrets](#secrets-configuration) for more details. |
3939
| `env` | object | N | | List of environment variables that the Apache JMeter script or Locust references. See [environment variables](#env-configuration) for more details. |
4040
| `certificates` | object | N | | List of client certificates for authenticating with application endpoints in the JMeter or Locust script. See [certificates](#certificates-configuration) for more details.|
41-
| `keyVaultReferenceIdentity` | string | N | | Resource ID of the user-assigned managed identity for accessing the secrets from your Azure Key Vault. If you use a system-managed identity, this information isn't needed. Make sure to grant this user-assigned identity access to your Azure key vault. Learn more about [managed identities in Azure Load Testing](./how-to-use-a-managed-identity.md). |
41+
| `appComponents` | object | N | | List of server -side resources to monitor during the load test. See [appComponents](#appComponents-configuration) for more details. |
4242
| `subnetId` | string | N | | Resource ID of the virtual network subnet for testing privately hosted endpoints. This subnet hosts the injected test engine VMs. For more information, see [how to load test privately hosted endpoints](./how-to-test-private-endpoint.md). |
4343
| `publicIPDisabled` | boolean | N | | Disable the deployment of a public IP address, load balancer, and network security group while testing a private endpoint. For more information, see [how to load test privately hosted endpoints](./how-to-test-private-endpoint.md). |
4444
| `regionalLoadTestConfig` | object | N | | Distribute load across regions to simulate user traffic from multiple regions. For more information, See [regional load test configuration](#regional-load-test-configuration) for more details. |
45+
| `referenceIdentities` | object | N | | List of managed identities used in the test for accessing the secrets from your Azure Key Vault, metrics for server-side failure criteria and authentication of your endpoints. See [referenceIentities](#referenceidentities-configuration) for more details. |
4546

4647
### Load test configuration sample
4748

@@ -77,15 +78,15 @@ keyVaultReferenceIdentity: /subscriptions/abcdef01-2345-6789-0abc-def012345678/r
7778
7879
### `failureCriteria` configuration
7980

80-
Test fail criteria enable you to define conditions to determine if a load test run was successful or not. If one or more fail criteria are met, the test gets a failed test result. Learn more about [using load test fail criteria](./how-to-define-test-criteria.md).
81+
Test fail criteria enable you to define conditions to determine if a load test run was successful or not. If one or more fail criteria are met, the test gets a failed test result. Learn more about [using load test fail criteria](./how-to-define-test-criteria.md). You can define failure criteria on client metrics, such as response time, latency, etc., and on server-side metricc for your server-side app components.
82+
83+
#### Client metrics
8184

8285
You can define fail criteria that apply to the entire load test, or that apply to a specific request. Fail criteria have the following structure:
8386

8487
- Test criteria at the load test level: `Aggregate_function (client_metric) condition threshold`.
8588
- Test criteria applied to specific JMeter requests: `Request: Aggregate_function (client_metric) condition threshold`.
8689

87-
#### Supported client metrics
88-
8990
Azure Load Testing supports the following client metrics:
9091

9192
|Metric |Aggregate function |Threshold |Condition | Description |
@@ -96,7 +97,23 @@ Azure Load Testing supports the following client metrics:
9697
|`requests_per_sec` | `avg` (average) | Numerical value with up to two decimal places. | `>` (greater than) <BR> `<` (less than) | Number of requests per second. |
9798
|`requests` | `count` | Integer value. | `>` (greater than) <BR> `<` (less than) | Total number of requests. |
9899

99-
#### Fail criteria configuration sample
100+
#### Server-side metrics
101+
102+
You can define fail criteria on server-side metrics for your server-side app components.
103+
104+
The following table describes the different fields in the `serverMetrics:` configuration:
105+
106+
|Parameter |Description |
107+
|---------------------|-------------|
108+
|`resourceId` | *Required.* The resource ID of app component on which the criteria should be applied |
109+
|`metricNamespace` | *Required.* The server-side metric namespace. |
110+
|`metricName` | *Required.* The server-side metrics on which the criteria should be applied. |
111+
|`aggregation` | *Required.* The aggregation to apply on the server-side metrics. |
112+
|`condition` | *Optional.* The comparison operator, such as `greater than`, or `less than`. |
113+
|`value` | *Required.* The numeric value to compare with the metric. |
114+
115+
116+
#### Failure criteria configuration sample
100117

101118
The following code snippet shows a load test configuration, which has three load test fail criteria.
102119

@@ -109,9 +126,71 @@ testPlan: SampleTest.jmx
109126
testType: JMX
110127
engineInstances: 1
111128
failureCriteria:
112-
- avg(response_time_ms) > 300
113-
- percentage(error) > 50
114-
- GetCustomerDetails: avg(latency) >200
129+
clientMetrics:
130+
- avg(responseTimeMs) > 300
131+
- percentage(error) > 50
132+
- getCustomerDetails: avg(latency) > 200
133+
serverMetrics:
134+
- resourceId: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.Compute/virtualMachines/sample-vm
135+
metricNamespace: Microsoft.Compute/virtualMachines
136+
metricName: Percentage CPU
137+
aggregation: Average
138+
condition: GreaterThan
139+
value: 80
140+
- resourceId: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.Compute/virtualMachines/sample-vm
141+
metricNamespace: Microsoft.Compute/virtualMachines
142+
metricName: Available Memory
143+
aggregation: Average
144+
condition: LessThan
145+
value: 20
146+
```
147+
148+
### `appComponents` configuration
149+
150+
You can monitor server-side resources during the load test. Learn more about [monitoring server-side resources](./how-to-monitor-server-side-metrics.md). When you run a load test for an Azure-hosted application, Azure Load Testing collects resource metrics for your application components and presents them in the load testing dashboard.
151+
152+
The following table describes the different fields in the `appComponents:` configuration:
153+
154+
|Parameter |Description |
155+
|---------------------|-------------|
156+
|`resourceId` | *Required.* The resource ID of app component on which the criteria should be applied. |
157+
|`resourceName` | *Optional.* The name of the resource to be monitored. |
158+
|`kind` | *Optional.* The kind of the resource to be monitired. |
159+
|`metrics` | *Required.* The list of metrics to be monitored for the app component. This contains the name, namespace, and aggregation for the metric. |
160+
161+
#### App Components configuration sample
162+
163+
The following code snippet shows a load test configuration, which has two app components.
164+
165+
```yaml
166+
version: v0.1
167+
testId: SampleTest
168+
displayName: Sample Test
169+
description: Load test website home page
170+
testPlan: SampleTest.jmx
171+
testType: JMX
172+
engineInstances: 1
173+
appComponents:
174+
- resourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appComponentResource"
175+
resourceName: appComponentResource #Optional
176+
kind: web # Optional
177+
metrics:
178+
- name: "requests/duration"
179+
namespace: microsoft.insights/components
180+
aggregation: "Average"
181+
- name: "requests/count"
182+
aggregation: "Total"
183+
namespace: microsoft.insights/components
184+
- resourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appComponentResource"
185+
resourceName: appComponentResource #Optional
186+
kind: web # Optional
187+
metrics:
188+
- name: "requests/duration"
189+
aggregation: "Average"
190+
namespace: microsoft.insights/components
191+
- name: "requests/count"
192+
aggregation: "Total"
193+
namespace: microsoft.insights/components
115194
```
116195

117196
### `autoStop` configuration
@@ -256,6 +335,55 @@ certificates:
256335
value: https://akv-contoso.vault.azure.net/certificates/MyCertificate/abc1234567890def12345
257336
```
258337

338+
### `referenceIdentities` configuration
339+
340+
You can use managed identities for various scenarios in your load test. Managed identities can be used in the test for accessing the secrets or certificates from your Azure Key Vault, fetching metrics for server-side failure criteria and authentication of your endpoints.
341+
342+
The following table describes the different fields in the `referenceIdentities:` configuration:
343+
344+
|Parameter |Description |
345+
|---------------------|-------------|
346+
|`kind` | *Required.* This defines the scenario for which the managed identity is being used. This can be one of the following `KeyVault`, `Metrics`or `Engine`. There can be multiple items for the kind `Engine`. |
347+
|`type` | *Required.* The type of identity. This can be `UserAssigned` or `SystemAssigned`. |
348+
|`value` | *Required.* The resource ID of the managed identity. This need not be provided if the type is `SystemAssigned`. |
349+
350+
#### Reference identities configuration sample
351+
352+
The following code snippet shows a load test configuration, for multiple identities.
353+
354+
```yaml
355+
version: v0.1
356+
testId: SampleTest
357+
displayName: Sample Test
358+
description: Load test website home page
359+
testPlan: SampleTest.jmx
360+
testType: JMX
361+
engineInstances: 1
362+
secrets:
363+
- name: my-secret
364+
value: https://akv-contoso.vault.azure.net/secrets/MySecret/abc1234567890def12345
365+
failureCriteria:
366+
serverMetrics:
367+
- resourceId: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.Compute/virtualMachines/sample-vm
368+
metricNamespace: Microsoft.Compute/virtualMachines
369+
metricName: Percentage CPU
370+
aggregation: Average
371+
condition: GreaterThan
372+
value: 80
373+
referenceIdentities:
374+
- kind: KeyVault
375+
type: UserAssigned
376+
value: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity
377+
- kind: Metrics
378+
type: SystemAssigned
379+
- kind: Engine
380+
type: UserAssigned
381+
value: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity
382+
- kind: Engine
383+
type: UserAssigned
384+
value: /subscriptions/abcdef01-2345-6789-0abc-def012345678/resourceGroups/sample-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sample-identity1
385+
```
386+
259387
## Requests JSON file
260388

261389
If you use a URL-based test, you can specify the HTTP requests in a JSON file instead of using a JMeter test script. Make sure to set the `testType` to `URL` in the test configuration YAML file and reference the requests JSON file.

0 commit comments

Comments
 (0)