Getting a circular feeder from user dependent data


I’m trying to implement a variation of the user dependent feeder from the documentation (, but instead of getting a random issue I want it to work like a circular feeder where it iterates through the relevant issues.

I have tried the code below, but I always get the first matching issue - any suggestions on how to get this working with Gatling 2.2.3?

import io.gatling.commons.util.RoundRobin

// index records by project
val recordsByProject: Map[String, IndexedSeq[Record[String]]] = csv(“projectIssue.csv”).records.groupBy{ record => record(“project”) }

// convert the Map values to get only the issues instead of the full records
val issuesByProject: Map[String, Iterator[Record[String]]] = recordsByProject.mapValues{ records => RoundRobin.apply(records) }

// inject project


.exec { session =>
// fetch project from session
session(“project”).validate[String].map { project =>
// fetch project’s issues
val issues = issuesByProject(project)

val selectedIssue =

// inject the issue in the session
session.set(“issue”, selectedIssue)


I managed to find the problem and learned something new about Scala today :slight_smile:

The problem is in my use of mapValues. The function is applied every time a value is retrieved from the map and not just once as I thought, see

Here is the working code:

val issuesByProject: Map[String, Iterator[Record[String]]] = { case (k,v) => k → (RoundRobin.apply(records)) }