Non Shared Data

Hi, I need to load data for users which is not shared. From the docs I can see this is possible with

val records = csv("foo.csv").readRecords

foreach(records, "record") {

However I don’t want to loop through all the records, just a certain number of them depending on a condition.

What’s the best way to do this? Is it possible with Gatling or will I need to write some Scala code to do it?


Use an asLongAs loop and pass a programmatic condition maybe?

Thanks for the reply, for now I went with a doIf inside the foreach loop. Your method above would still involve using the asLongAs inside of the foreach? Or did I misunderstand?

.foreach(getSelectionFeeder(betType, inPlay), "SelectionID", "count") {
      session => session("count").as[Int] < 1 &&