TPS / BPS Calculation
Let’s understand the TPS / BPS Calculation. Calculation of the different values in the Statistics table is straight-forward for all columns except TPS (transactions per second) and BPS (bytes per second). These two can be calculated in two different ways-
- Firstly, based on the actual time passed (default):
- Secondly, TPS: CNT/Seconds passed, i.e. a TestCase that has run for 10 seconds and handled 100 requests will get a TPS of 10
- Subsequently, BPS: Bytes/Time passed, i.e. a TestCase that has run for 10 seconds and handled 100000 bytes will get a BPS of 10000.
- Further, based on average execution time:
- After this, TPS: (1000/avg)*threadcount, for example, avg = 100 ms with ten threads will give a TPS of 100
- Lastly, BPS: (bytes/CNT) * TPS, i.e. the average number of bytes per request * TPS.
Example
A TestCase with two groovy scripts. The first sleeping for 900ms and the second for 100ms. So, we’ll run this with 10 threads for 10 seconds, which theoretically should result in 100 executions of our TestCase;
With TPS being calculated on time passed, the value is the same for both TestSteps. Since it executes the same number of times during our 10 seconds. Their individual execution speeds do not affect this value.
Now let’s change the way TPS is calculated to be based on average (in the LoadTest Options dialog):
So, if we now run the test we get the following:
Here is the hypothetical TPS for the first teststep is calculated to be 11, Since with 10 parallel runs the average time was 909ms. The second teststep gets 100 TPS. Once again calculated with 10 parallel runs which took 99ms on average (if this was sustained performance we could theoretically have “squeezed in” 100 requests in each second).
Which of these two to use is up to you; with single step TestCases you should get roughly the same result from both, but when your TestCases contain many steps, both ways have their pros and cons (as illustrated above).
Make your resume stand out and become a Certified SoapUI Testing Professional. Try free practice tests here!
A great career is just a certification away. So, practice and validate your skills to become a Certified SoapUI Testing Professional.