Hi I’m using gatling 2.3 and trying to use gatling feeders.
I need to use single feeder file for multiple feeder objects with circular strategy and I need the data, that I get from the feeder to be taken in parallel…
Smth like this:
package test
import io.gatling.core.Predef._
import io.gatling.core.feeder.RecordSeqFeederBuilder
import io.gatling.core.structure.ScenarioBuilder
import scala.concurrent.duration._
class Profile extends Simulation {
val first_feed: RecordSeqFeederBuilder[String] = csv("test.csv").circular
val second_feed: RecordSeqFeederBuilder[String] = csv("test.csv").circular
val first_scn: ScenarioBuilder = scenario("First scenario").repeat(1) {
feed(first_feed).exec((session: Session) => {
println("First scenario pick: " + session("value").as[String])
session
})
}
val second_scn: ScenarioBuilder = scenario("Second scenario").repeat(1) {
feed(second_feed).exec((session: Session) => {
println("Second scenario pick: " + session("value").as[String])
session
})
}
setUp(
first_scn.inject(rampUsers(5) over 3.seconds),
second_scn.inject(rampUsers(5) over 3.seconds),
)
}
With test.csv file like this:
value
1
2
3
4
5
Output is:
First scenario pick: 1
Second scenario pick: 2
First scenario pick: 3
Second scenario pick: 4
First scenario pick: 5
Second scenario pick: 1
Second scenario pick: 2
First scenario pick: 3
Second scenario pick: 4
First scenario pick: 5
The result is exactly the same as if we were reading data from one feeder object. But I need output like this:
First scenario pick: 1
Second scenario pick: 1
First scenario pick: 2
Second scenario pick: 2
First scenario pick: 3
Second scenario pick: 3
Second scenario pick: 4
First scenario pick: 4
Second scenario pick: 5
First scenario pick: 5
Are there any simple solutions for this problem?