2

I need to make a random pause of 2 to 5 seconds between requests. I suppose, that it is a constant timer with such settings as ${__Random(2000,5000)}. I can't understand where should I create this timer: in thread group after all requests, or after every request in thread group? How can I check via listeners, that timer works correctly?

Thanks to Amol, I understood, that my config doesn't work with multiple threads.

So I need 10 threads and 10 iterations with a random pause of 2 to 5 seconds between requests.

2
  • Does your thread-group have only one request? Jun 21, 2020 at 17:44
  • There are several requests. Jun 22, 2020 at 15:21

1 Answer 1

2

If you want to have a random pause between every request, you need to add timer as 'sibling' to your samplers [requests], that means add constant timer as a child to thread-group.

How to use Constant Timer for random pause-

enter image description here

It won't make any difference if you add it as a first child or after all samplers. For better understanding, I suggest you to read scoping in Jmeter

Example here:-

enter image description here

You can easily see the randomness requests being made using View Results in Table. it has Start Time column which gives idea. I have used debug sampler for example again:

enter image description here

Hope this helps.

EDIT:-

If I disable the constant-timer, I can see all the request being made in the span of 1ms:

enter image description here

8
  • 2
    Thanks for your answer, Amol. How can I check that timer works correctly? If I check "View Results in Table" I can see, that all request go without configured random pause. Jun 21, 2020 at 16:59
  • 1
    @DenisFilatov : Are you facing any issue? Jun 21, 2020 at 17:09
  • 1
    If number of threads 1, it works correctly. If number of threads 10, I can see similar behavior as on 4th screen. Jun 21, 2020 at 17:15
  • 1
    That can happen as scoping is on thread-group, In the above example, we are saying that all the request in the same thread group should have some random pause time between 2 to 5 seconds, we are not talking about multiple threads. Jun 21, 2020 at 17:20
  • 1
    If you want to control the behaviour on multiple thread level, I suggest you to use Ramp Up Jun 21, 2020 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.