Let’s think about an end-to-end scenario for an e-commerce website. A user logs in, goes to the main page, searches for a product, sees the results and goes to the detail page of one option. Then the user will continue with performing cart and payment steps.
A real time user would be executing this scenario slowly. Because during the flow; he/she will think about his/her budget, try to find out the most charming option then fill the credit card info slowly. But a thread in JMeter; can execute this scenario much faster than a real time user, if you don’t add think time or similar elements between requests in your script.
A basic JMeter Test Plan contains a Thread Group, requests for your scenario and usually a View Results Tree element. But with these elements you can only manage the number of users, not the frequency of requests. So what a “ Constant Throughput Timer ” does, is help you to manipulate the frequency of requests.
With this timer element, you can keep your total throughput value as constant. But that doesn’t mean that your test will absolutely reach that throughput value. If your system has some kind of problems or a bottleneck occurs during the test flow, your throughput value may be lower.
And what is more, throughput value doesn’t need to be constant, you can even change this value during your test flow. Let’s prepare a simple test scenario with a Constant Throughput Timer.
A Constant Throughput Timer will look like the picture above. You can add this element to your test plan by following “Thread Group -> (right click) -> Add -> Timer -> Constant Throughput Timer” path.
Target throughput (in samples per minute) value lets you manage the frequency for your requests. If you set its value as “1.0” your throughput during the test will be 1 request per minute.
Enjoy load testing:)