1
votes

I am trying to configure a test for signup-login with invalid credentials imitating bruttforce attack. However, I want to make requests as a single user. So the scenario is the next:

  1. Request to sign up with valid params;
  2. Attempt to log in with invalid params in a loop.

I am adding throughput timer but then I need to set up a high number of threads to generate for example 1 request per second. request Thread configuration

How can I set exactly one user and run only one request per second in a loop?

UPDATE - SOLUTION

Everything was rather simple but still strange for me. Maybe someone will face the same problem. To get a number of requests per one user throughput timer should be placed not inside the controller but inside the thread itself.

timer position result

2

2 Answers

0
votes

To achieve Target Request Per Second use Throughout Shaping Timer : How to use Throughput Shaping Timer

JMeter Plugin link : Download from here

Few Important Notes:

  1. JMeter threads of Thread Groups in scope of the Element will be stopped when RPS schedule finishes.
  2. Provide enough working threads for your RPS, JMeter timers can only delay threads (and limit RPS). You may pair this plugin with Concurrency Thread Group using Schedule Feedback Function to dynamically maintain thread count required to achieve target RPS.
  3. If you're using versions of JMeter lower than 3.3 and if you have RPS that lower at the end of test, make threads to lower also. Оtherwise you'll have a spike in last second.
  4. Avoid using zero RPS value as start of test, this produce spike also
  5. Avoid zero RPS during the test, this may lead to nasty effects

Now, practical example showing 1 RPS for 1 User:

enter image description here enter image description here

0
votes

You might want to reconsider the location of the timer, it obeys JMeter Scoping Rules so it gets applied to all Samplers which are in your Thread Group.

If you want to apply it to only one - make it a child of the relevant sampler.

Also be aware that Constant Throughput Timer is precise enough on minute level so you might want to switch to the Precise Throughput Timer