Custom feeder repeats only first line

928 views
Skip to first unread message

Serega Sheypak

unread,
Jan 26, 2015, 3:37:35 PM1/26/15
to gat...@googlegroups.com
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.



Stéphane LANDELLE

unread,
Jan 26, 2015, 3:45:18 PM1/26/15
to gat...@googlegroups.com
Move feed inside the repeat loop.

Stéphane Landelle
Lead developer


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Serega Sheypak

unread,
Jan 26, 2015, 4:34:58 PM1/26/15
to gat...@googlegroups.com
Thanks,

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

works! problem is solved.

понедельник, 26 января 2015 г., 23:45:18 UTC+3 пользователь Stéphane Landelle написал:

Abhinav Gogna

unread,
Jan 26, 2015, 5:12:31 PM1/26/15
to gat...@googlegroups.com
Interesting! I thought to use custom functions, you have to call exec(session=> .... I guess I learnt something new today. Thanks Serega!
Reply all
Reply to author
Forward
0 new messages