Custom feeder repeats only first line

Hi, I have a function which returns feeder data, it’s dead simple synthetic.

def generateFeeder(limit :Int) :Array[Map[String,String]] = {
  import scala.collection.mutable.ListBuffer
  //some stuff here
  list.toArray
}

I print generateFeeder result to console and see that I have different records

Here is my code:

val historyScn = scenario(nameHistoryScn)
  .feed(generateFeeder(limit).queue)
  .repeat(limit){
    exec(
      http("Setting up data for test")
        .post(postHistory)
        .param(visitParam, "${visit}")
        .check(status.is(200))
    ).pause(5 seconds)
  }    

setUp(
  historyScn.inject(atOnce(1))
).protocols(httpConf)

and gatling sends only first line limit times
limit is equal to feeder items count. I want gatling to send all records, not just the first record X times.

Move feed inside the repeat loop.

Thanks,

val historyScn = scenario(nameHistoryScn)
  .repeat(limit){
    feed(generateFeeder(userId, shopId, limit).queue)
    .exec(

works! problem is solved.

Interesting! I thought to use custom functions, you have to call exec(session=> … I guess I learnt something new today. Thanks Serega!