Consolidating CSV results files in Azure Load Testing
Published Jan 22 2024 03:42 AM 3,208 Views
Microsoft

Azure Load Testing (ALT) provides a rich and consolidated dashboard to analyze your load test results. However, you can also download or export the test results, build your own dashboards and reporting, for example, using Microsoft Excel or Power BI. You can also use JMeter backend listeners to write the results to a data store of your choice and analyze the data.

When you use the download results option, the ALT service splits the results into one CSV file per engine. This ensures that the file size is not huge, and it is easy to open the files in tools like Notepad, Microsoft Excel to analyze the data. In cases where your input data is split across test engines, you can pick the results file for a specific engine and analyze.

 

Nagarjuna_V_4-1705576581970.png

Nagarjuna_V_5-1705576596792.png

If you want to get one consolidated view of the test run results in a single file – to compute aggregate values of response time across all the requests, to calculate the number of errors of a specific type for a request etc., you will have to go through a few manual steps to extract the zip file, open each CSV and copy the data into a single file. In this blogpost, we will walk you through two ways in which you can leverage automation for this scenario.

  1.        Download the results and consolidate into a single CSV file. You can use this option if you wish to automate the results download step as well. We will demonstrate this using a Python script.
  2.        Extract the downloaded Zip file and consolidate into a single CSV file. This is suitable if you have already downloaded the results file and you do not want to use any ALT APIs/SDKs for this automation. We will demonstrate this using a PowerShell script.

Download the results and consolidate into a single CSV file

In this approach, you can provide the test run ID as the input and use the Azure Load Testing APIs/SDKs to download the results zip file and then extract it and consolidate the results.

For this blogpost, we used the ALT SDK for Python to create a Python script that does the following:

  1.        Download the results zip file using the test run ID.
  2.        Unzip the file to a local directory.
  3.        Open each CSV file and add the engine number as an additional column.
  4.        Copy the data from each CSV file into a single consolidated CSV file.
  5.        Save the consolidated file to the same directory.

Nagarjuna_V_6-1705576626210.png

To try this out for your test runs,

  1.        Download the script.
  2.        Update the config file to provide the inputs related to your subscription and your Azure Load Testing resource.
  3.        Run the script to perform the five steps described above.

The same can also be achieved by using the REST APIs or the SDKs for .NET, Java and JavaScript.


Extract the downloaded Zip file and consolidate into a single CSV file

If you have already downloaded the results zip file to your local directory, you can skip the step to download the results using ALT APIs/SDKs in your automation script and just perform steps 2 through 5. You can use this PowerShell script to achieve this in the following steps.

  1.       Download the script to the same directory where you have the results zip file. If you choose to run the script from another directory, update the script directory path.
  2.       Run the script to extract the zip file and create a consolidated CSV file in the same directory.

To summarize, we have seen two approaches to leverage automation to simplify the process of consolidating the results from an Azure Load Testing test run into a single CSV file.

If you haven’t tried Azure Load Testing yet, create an Azure Load Testing resource and get started with your first test run in a few minutes. Let us know your feedback through our feedback forum.


Happy load testing!


Additional resources:

Azure Load Testing resources: https://aka.ms/MALT-resources.

Previous blogposts on Azure Load Testing here.

Co-Authors
Version history
Last update:
‎Mar 05 2024 09:58 PM
Updated by: