0
votes

I am testing web app. Basically I have 1 thread group (lets call them affiliates) who on average need to perform 2.5 requests per second (each request being a request for an imaginary advert). The second thread group (end users) needs "click" on 10% of these adverts requested by the Affiliates.

I have the following setup:

Test setup

Each Thread group has a ramp up time of 1(s). The constant timer for the first thread group (Affiliates) is 400ms (1second / 2.5clicks = 1 click per 0.4 seconds = 1 click per 400ms). If I have understood correctly this should make sure that each affiliate should click once every 400ms.

The second thread group has a constant timer of 4000ms (since the timer is a delay then 4000ms makes should result in 10% requests of the first thread group).

When testing with one user, the results are fine, as I increase the users however (for example at 150 users per thread group (300 total users)) the results are no longer AdClick 10% of AdRequests.

Running my test for 1 minute I get the following: AdsRequest = 4695 samples AdsClicked = 1568 samples

AdsClicked should be about 470 samples

So my question is: How can I set up my test to constantly have 10% samples of AdRequests for Adclicked, irregardless of how many users are currently using the system.

1

1 Answers

0
votes
  1. Your setup is not very correct in terms of Constant Timers location. According to Timers Documentation:

    Note that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler.

    Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all. To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Action Sampler.

  2. If you need to manipulate throughput (requests per second) it is better to consider Constant Throughput Timer or Throughput Shaping Timer

  3. As you don't have guarantee of exact 10% match using the Timers for this requirement:

    irregardless of how many users are currently using the system

    you can consider moving both samplers under single Thread Group and use Throughput Controller or Switch Controller to make your AdsClicked request to be exactly 10% of AdRequests. See Running JMeter Samplers with Defined Percentage Probability article for more details on the approach.