Jmeter

Vraj Patel
2 min readJul 18, 2023

To create a test plan in JMeter that fulfills your requirements, you can follow these steps:

1. Install JMeter: Download and install JMeter from the Apache JMeter website (https://jmeter.apache.org/).

2. Create a Test Plan: Launch JMeter and create a new Test Plan by selecting “File” > “New Test Plan” from the menu.

3. Thread Group: Right-click on the Test Plan and select “Add” > “Threads (Users)” > “Thread Group”. Configure the Thread Group as follows:
— Number of Threads (users): 25
— Ramp-Up Period: 1 (This means all 25 threads will start simultaneously.)
— Loop Count: 1 (This means each thread will execute the requests only once.)

4. HTTP Request Defaults: Right-click on the Thread Group and select “Add” > “Config Element” > “HTTP Request Defaults”. Configure the HTTP Request Defaults with your REST API URL, username, and password.

5. Create First Hour Request Pattern: Right-click on the Thread Group and select “Add” > “Sampler” > “HTTP Request”. Configure the HTTP Request with the first JSON payload and any necessary settings.

6. Constant Throughput Timer: Right-click on the Thread Group and select “Add” > “Timer” > “Constant Throughput Timer”. Configure the Constant Throughput Timer to achieve 25 requests every 2 minutes. Set the Target Throughput (requests per minute) to 12.5 (25 requests / 2 minutes).

7. Duplicate Sampler and Timer: Right-click on the HTTP Request and Constant Throughput Timer created in steps 5 and 6, respectively. Select “Duplicate” to create additional instances.

8. Modify Timers: Double-click on each Constant Throughput Timer and adjust the Target Throughput to match the desired request pattern for each hour. For example, set it to 25 requests per 2 minutes for the first hour, 50 requests per 2 minutes for the second hour, and 200 requests per 2 minutes for the third hour.

9. Adjust Thread Group: Right-click on the Thread Group and select “Add” > “Threads (Users)” > “Thread Group”. Configure the newly added Thread Group with the same settings as before (25 threads, 1 ramp-up period, 1 loop count).

10. Duplicate Samplers and Timers: Right-click on the newly added Thread Group and select “Duplicate”. This will create two additional Thread Groups.

11. Adjust Timers in Each Thread Group: Double-click on the Constant Throughput Timers in the second and third Thread Groups and modify the Target Throughput to match the desired request pattern for each hour.

12. Run the Test Plan: Save the test plan and click on the green “Play” button to start the test. JMeter will simulate the specified number of concurrent threads and execute the requests according to the defined patterns.

By following these steps, you can create a JMeter test plan that sends the requested number of requests with the specified patterns over a three-hour duration.

--

--