How achieve same time of requests ?

How achieve same time of requests ?
I try sth like that:

pace(5 seconds).exec(http("1").post(...)).``pace(5 second).exec(http("2").post(...))``

but this don’t work as I expected. If I replace pace on pause then i can see that pause work, but pace not work in this way

nobody run test with constant request ratio ?

W dniu poniedziałek, 7 września 2015 13:37:51 UTC+2 użytkownik Radosław Twardy napisał:

It is not clear to me what you are trying to accomplish. What is the specific behavior you want?

For example:
Scenario have 3 requests:

  • processing 1. request take 1s
  • processing 2. request take 2s
  • processing 3. request take 3s

I wont constant rate 5s for requests so i expected
pause after 1. request - 4s
pause after 2. request - 3s
pause after 3. request - 2s

I think that i only need to call pace(5 second) after/before each request but it don’t work in this way

Define as three different scenarios. Inject at a rate of 1 user every 5 seconds. You will get exactly what you describe.

I don’t understand your suggestion.

I have some piece of code similar to:

exec(pause(5 seconds).http(“1”).post(“url1”).body("…"))
.exec(pause(5 seconds).http(“2”).post(“url2”).body("…"))

.exec(pause(5 seconds).http("3").post("url3").body("...")) ``


This is work fine - before each request occurs pause which takes 5s.
But if I change pause to pace, because i wont pause which take 5s minus request time - then this not work (any pause was applied).
I don’t understand why. How can i achieve this behavior ?

You advise me:

Inject at a rate of 1 user every 5 seconds.

but i don’t understand what injecting users can be relate to my case

Pause means “from the time the last request FINISHED, wait a certain amount of time before continuing with execution.”

What you want (at least, based on what you have said) is: I want a fixed amount of time to elapse between when requests START.

Pace is probably NOT what you want. It is meant to be used in a loop.

Try getting rid of the pauses, and then throw a throttle onto the scenario to limit you to one request every 5 seconds. It is a bit heavy handed, because it throttles the whole scenario, and not just a sequence within the application flow. But if that works for you, then you will have a solution.