I want to implement spike test in gatling shown in the image [in the image you can see 9 spikes I want to implement such a way that we can dynamically pass the spikes at run time like if I enter no. of spikes as 5 it should do 5 time spike]
scenario.inject(
rampUsers (10) during (2),
constantUsersPerSec(10) during (5),
(1 to 4).flatMap(i => Seq(
rampUsers(100) during (2),
constantUsersPerSec(100) during (20),
rampUsers(10) during (2))
),
constantUsersPerSec(10) during (20),
rampUsersPerSec(10) to 1 during (2)
).protocols(httpProtocol)
but getting this error
could not find implicit value for evidence parameter of type io.gatling.core.controller.inject.InjectionProfileFactory[Equals]
Basically, what you’re currently doing is like inject(A, A, Seq[A], A, A). This can’t possibly work. You need to concatenate your individual elements and your sequence so you end up with inject(Seq[A]).
You are on the right path!
As @slandelle wrote, you have to make a single Seq before giving it to inject.
Look at the way to manipulate Seq and append, prepend what you already have.
To help you, extract the whole content of inject into a val (should be a Seq[...])