Export test results from Azure Load Testing for use in third-party tools
Alt
In this article, you learn how to export your Azure Load Testing test results and reports. You can download the results by using the Azure portal, as an artifact in your CI/CD workflow, in JMeter by using a backend listener, in Locust by using event hooks or listener plugins, or by copying the results from an Azure storage account. You can use these results for reporting in third-party tools or for diagnosing test failures. Azure Load Testing generates the test results in comma-separated values (CSV) file format, and provides details of each application request for the load test.
You can also use the test results to diagnose errors during a load test. The responseCode and responseMessage fields give you more information about failed requests. For more information about investigating errors, see Diagnose failing load tests.
You can generate the Apache JMeter dashboard from the CSV log file following the steps mentioned here.
You can also download the Azure Load Testing Result dashboard as an HTML report for offline viewing and collaboration.
Prerequisites
An Azure account with an active subscription. If you don't have an Azure subscription, create a free account before you begin.
An Azure Load Testing resource that has a completed test run. If you need to create an Azure Load Testing resource, see Create and run a load test.
You can find the details of each application request for the load test run in the test results file. The following snippet shows a sample test result:
Output
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1676040230680,104,Homepage,200,OK,172.18.33.7-Thread Group 1-5,text,true,,1607,133,5,5,https://www.example.com/,104,0,100
1676040230681,101,Homepage,200,OK,172.18.33.7-Thread Group 1-3,text,true,,1591,133,5,5,https://www.example.com/,101,0,93
1676040230680,101,Homepage,200,OK,172.18.33.7-Thread Group 1-1,text,true,,1591,133,5,5,https://www.example.com/,98,0,94
Access and download load test results and report
After a load test run finishes, you can access and download the load test results and the HTML report through the Azure portal, or as an artifact in your CI/CD workflow.
Tábhachtach
For load tests with more than 45 engine instances or a greater than 3-hour test run duration, the results file is not available for download. You can configure a JMeter Backend Listener to export the results to a data store of your choice or copy the results from a storage account container.
For tests with samplers greater than 30, the downloaded HTML report will only have graphs for data aggregated over all samplers. Graphs will not show sampler-wise data. Additionally, the downloaded report doesn't support graphs corresponding to server-side metrics.
To download the test results and the HTML report for a test run in the Azure portal:
In the Azure portal, go to your Azure Load Testing resource.
On the left pane, select Tests to view a list of tests, and then select your test.
Nod
To limit the number of tests to display in the list, you can use the search box and the Time range filter.
You can download the test results file as a zipped folder in either of two ways:
Select the ellipsis (...) next to the load test run you're working with, and then select Download results file.
Nóta
A load test run needs to have a Done, Stopped, or Failed status for the results file to be available for download.
Select Download on the Test run details pane. To download the results, select Results. To download the HTML report, select Report.
You can use any zip tool to extract the folder and access the downloaded files.
The results folder contains a separate CSV file for every test engine and contains details of requests that the test engine executed during the load test.
The report folder contains an HTML file that provides a summary of the test run and graphs of the performance metrics for offline viewing and collaboration.
When you run a load test as part of your CI/CD pipeline, Azure Load Testing generates test results and reports. Follow these steps to publish these test results and attach them to your CI/CD pipeline run:
Go to your GitHub repository, and select Code.
In the Code window, select your GitHub Actions workflow YAML file in the .github/workflow folder.
Edit the workflow file and add the actions/upload-artifact action after the azure/load-testing action in the workflow file.
Azure Load Testing places the test results and the HTML report in the loadTest folder of the GitHub Actions workspace.
After your GitHub Actions workflow completes, you can select the loadTestResults folder from the Artifacts section on the Summary page of the workflow run.
When you run a load test as part of your CI/CD pipeline, Azure Load Testing generates a test results file. Follow these steps to publish these test results and attach them to your CI/CD pipeline run:
In your Azure DevOps project, select Pipelines in the left navigation, and select your pipeline from the list.
On the pipeline details page, select Edit to edit the workflow definition.
Edit the workflow file and add the publish task after the AzureLoadTest task in the workflow file.
Azure Load Testing places the test results and the HTML report in the loadTest folder of the Azure Pipelines default working directory.
After your Azure Pipelines workflow completes, you can select the test results from the Stages section on the Summary page of the workflow run.
You can find and download the test results and the report in the Results folder.
Export test results using listeners
For JMeter-based tests, you can use a JMeter backend listener to export test results to databases like InfluxDB, MySQL, or monitoring tools like Azure Application Insights.
You can use the default JMeter backend listeners, backend listeners from jmeter-plugins.org, or a custom backend listener in the form of a Java archive (JAR) file.
The following code snippet shows an example of how to use the backend listener for Azure Application Insights, in a JMeter file (JMX):
XML
<BackendListenerguiclass="BackendListenerGui"testclass="BackendListener"testname="Backend Listener"enabled="true"><elementPropname="arguments"elementType="Arguments"guiclass="ArgumentsPanel"testclass="Arguments"enabled="true"><collectionPropname="Arguments.arguments"><elementPropname="testName"elementType="Argument"><stringPropname="Argument.name">testName</stringProp><stringPropname="Argument.value">jmeter</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="connectionString"elementType="Argument"><stringPropname="Argument.name">connectionString</stringProp><stringPropname="Argument.value">Enter your AppInsights connection string</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="liveMetrics"elementType="Argument"><stringPropname="Argument.name">liveMetrics</stringProp><stringPropname="Argument.value">true</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="samplersList"elementType="Argument"><stringPropname="Argument.name">samplersList</stringProp><stringPropname="Argument.value"></stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="useRegexForSamplerList"elementType="Argument"><stringPropname="Argument.name">useRegexForSamplerList</stringProp><stringPropname="Argument.value">false</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="logResponseData"elementType="Argument"><stringPropname="Argument.name">logResponseData</stringProp><stringPropname="Argument.value">OnFailure</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp><elementPropname="logSampleData"elementType="Argument"><stringPropname="Argument.name">logSampleData</stringProp><stringPropname="Argument.value">OnFailure</stringProp><stringPropname="Argument.metadata">=</stringProp></elementProp></collectionProp></elementProp><stringPropname="classname">io.github.adrianmo.jmeter.backendlistener.azure.AzureBackendClient</stringProp></BackendListener>
Copy test artifacts from a storage account container
Tábhachtach
Copying test artifacts from a storage account container is only enabled for load tests with more than 45 engine instances or with a test run duration greater than three hours.
To copy the test results and log files for a test run from a storage account, in the Azure portal:
In the Azure portal, go to your Azure Load Testing resource.
On the left pane, select Tests to view a list of tests, and then select your test.
From the list of test runs, select your test run.
Nod
To limit the number of tests to display in the list, you can use the search box and the Time range filter.
On the Test run details pane, select Copy artifacts.
Nóta
A load test run needs to be in the Done, Stopped, or Failed status for the results file to be available for download.
Copy the SAS URL of the storage account container.
You can use the SAS URL in the Azure Storage Explorer or AzCopy to copy the results CSV files and the log files for the test run to your storage account.
The SAS URL is valid for 60 minutes from the time it gets generated. If the URL expires, select Copy artifacts to generate a new SAS URL.
Demonstrate understanding of common data engineering tasks to implement and manage data engineering workloads on Microsoft Azure, using a number of Azure services.