Telemetry API: Executing the Load & Stress Test
This pages is a guide and contains assets to make the process of run the Load & Stress Test simpler.
Motivation
We know our tool is important, that's why we create a plan for testing the telemetry API, but this process could be a bit repetitive to repeat over an over. Because of that we have created this guide, to help you and give you tools to make this process simpler and faster.
Gathering information from the Assessment DB
In order to create a better testing plan, before start to define each test, we gather information from the database like the average and maximum executions per day (for each product), the average of events per execution, etc...
Here you can use this queries to help you out and you don't need to create them from scratch.
This file contains a bunch of queries like:
SessionsByProduct
SessionsByProductWithDate
SessionsByProductPerDay
AverageSessionsByProductPerDay
AverageSessionsByProductPerHour
MaxSessionsByProductPerDay
DurationBySessionByProduct
AverageDurationByProduct
EventsBySession
AverageEventsBySession
You just need to change the name of the query in the FROM section of the select and hit "Execute".
There are some pre-selected products, you can add or remove new names of products, depending in which are you interested in to analyze.
Speeding up the test data calculation with an Excel Sheet
Similarly to the previous section, here we have an Excel file where once you finished of gathering information you update the information on the Excel and automatically get the results of the calculation to go to define the tests cases.
As mentioned before, one you finished of gathering information, all you need is to update the data within each sheet from the excel file, and in the "Total" sheet you'll get the results ready to use in the test definitions.
Creating an equivalent shorter test
Once you got the results it's time to start defining the test cases of your test plan, but before you jump in to the execution of your test, we want to advice to make this process faster.
Let's assume that you have already defined a test case.
Test ID | Executions | Number of Requests | Number of Events per Request | API Method | Total Time |
---|---|---|---|---|---|
1 | 239 | 3 | 5 | POST Events | 3600s |
Considering 60 min / 4 = 15 min, then if the actual test is making 717 threads in one hour it would be the same make 717 / 4 = 180 threads in 15 minutes.
By making that, now you can run the equivalent 15 minutes test.
Number of Threads (users): 180
Ramp-up (secs): 900
Loop: 1
Finally
This is just a guide and/or files to help in the process, feel free to update them or add more sections to this page to improve the process of the testing API.
You can download this .zip with all the files required to replicate the plan test and with the results of the last test plan (16/11/2022).
Last updated