Hi, I am new to gatling, I have a test scenario works like:
N-users
Loop {
- Run a request at the same time.
- Wait all done and verify it (only one request)
}
With rendezVous and doIf should fulfill this use case,
it looks like the rendezVous point doesn’t block until all users come.
Any suggestion?
val userIdFeeder = Iterator.from(0).map(i => Map(“id” → i))
val Users = 3
val testScenario = scenario(“test”)
.feed(userIdFeeder)
.forever(“round”) {
rendezVous(Users) // make sure request at the same time
.exec(
s => {
println(String.format("[Round %s] Step 1", s(“round”).as[Integer]))
s
}
)
.pause(500 milliseconds, 2500 milliseconds)
.rendezVous(Users) // wait until all completes, then run checks
.doIf("${id}", “0”) {
exec(
s => {
println(String.format("[Round %s] Step 2 – only once\n\n", s(“round”).as[Integer]))
s
}
)
}
}