I am looking to execute performance testing with use case,
lets say I have Scenario with 5 Http request of chain and would like to execute first Request with 100% configured threads/Vusers then drop threads by 10% for second transitions and 3rd transition by 10%.
*do we have any function available in Gatling to configure such scenario?*
Ex.
val scn = scenario("Login")
.exec( . // 100%
http("Request1")
.get("Request-1")
.check(status is 302)
.disableFollowRedirect
).pause(2 seconds)
Create a random number between 0 to 100 and specif icy the condition which are the requests need to be included in that.
e.g val randomInt = ThreadLocalRandom.current.nextInt(100)
Have this in your journey/scenario setup.
.doIf(session => session(“randomInt”).as[Int] <=100){exec(Request-1)}
how to ensure that Request-1 will execute 100% and the subsequentRequest-2will execute 90% and soo on**.** becausehere is a random number getting for each thread.
below is my script, I do have simulation setup for to run for 15min with 10 Vusers and 120 sec rampup. so these 10 threads will be active till 15min.
Ex. one thread start with Request1 will execute till Request5. and same thready willreiterateagain till 15min. in this case i wanted to execute Request1 100% and Request2 90% of 100% and Request3 80% of 90%.
For example for a total of 300 users the number that reach secondStep was 63 and thirdStep was 33.
I was expecting 60 and 30 or at least that is what I am looking for.
Don’t you mind help me to understand better this.
Thanks in advance!
First, @sbrevet 's algorithm has an off-by-one error .
Counter starts at 1 and condition uses <= so for 300 users, (1 to 20) + (100 to 120) + (200 to 220) + (300) = 20 + 21 + 21 + 1 = 63 users will execute secondStep.
The counter must start at 0 and the condition use < so you get (0 to 19) + (100 to 119) + (200 to 219) = 60 users.
Then, there’s no need for this myCountFeeder if you’re using one single scenario as users have a builtin global counter.