0
votes

I've been asked to carry out some testing to assess the response time under varying load on an API that is being developed in my current job. I’ve got a very basic knowledge of jMeter so I’m looking at this as my chosen tool to use.

Here’s quick Back ground info of what I’m tying to achieve: I want to test the API by simulating a number of unique Json calls each made by different users. Each unique Json call contains a unique user ID and item number.

Lets say for example I want to test, 10 different users, all making calls for different Items to the API at once.

I’m a little confused with the terminology and difference between thread groups and users and loop count (which are found inside thread groups) and how best to use them. I couldn't find an answer on the jMeter site or on here so have come up with what I think may be a possible approach....

From my understanding of how jMeter works. In order for me to achieve my aim would require me to create 10 separate thread groups within the test plan, each of these having their unique Json body data configured.

For example : Thread group 1 containing request 1, Thread group 2 containing request 2, Thread group 3 containing request 3, Thread group 4 containing request 4, Thread group 5 containing request 5.... and so on. ( note, I would uncheck the option ‘run thread groups consecutively so that all requests get sent at once)

If the number of users and the loop count in each thread group is set to 1 then each call is made only once. Meaning a total of unique 10 calls would be made during a single test run?

I guess, what I’m kind of asking is in my scenario, does the term thread group actually represent unique users, and if so what does the number of threads(users) actually represent

I think I've got this right but it would be good if someone more experienced might be able to add some confirmation or advice to point me in the right direction if I've got this wrong.

2

2 Answers

0
votes

Thread Group is an element in JMeter test plan which is responsible for executing the scenario/business work flow for the given set of users & for the given duration(or iteration/loop count).

Lets say I have a business flow like this.

users login
search for product
select a product
order the product

Another business flow for the same application would be

Admin users login
Search for users
modify the order/cancel the order/issue refund

I would create 2 thread groups for 2 different work flows.

In production/live environment, I might have 1000 users searching for products and 500 users might be placing the order.

I might have only 10 admin users to provide support for 1000 users - to provide refund/modify the order etc. [some might do refund / some cancel / some modify]

So,

Thread Group 1 [users1=1000, rampup=3600,loop count=forever, duration=7200(2 hrs)]

users login
search for product
If Controller [let only 500 users to order product]
    select a product
    order product



Thread Group 2 [users1=10, rampup=600,loop count=forever, duration=7200(2 hrs)]

Admin users login
Search for users
Throughput controller [40%]
    modify the order
Throughput controller [30%]
    cancel the order
Throughput controller [30%]
    some other support

As you mention you are new to JMeter, I would suggest you to check this.

  1. JMeter Tips/Tricks for beginners / Best Practices
  2. JMeter - REST API Testing
0
votes

I believe using Synchronizing Timer to ensure all 10 threads are running at exactly the same moment will be easier and smarter choice.


And this is some general information regarding how JMeter works:

  • JMeter starts the specified amount of threads during ramp-up period
  • Each thread starts executing samplers upside-down (or according to the Logic Controllers)
  • When there are no samplers to execute and loops to iterate - thread is being shut down. Elsewise it starts over until desired test duration or loops count is met/exceeded.

Hopefully it clarifies everything