Hi,
I’m trying to implement a variation of the user dependent feeder from the documentation (http://gatling.io/docs/2.2.3/session/feeder.html#user-dependent-data), 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
feed(csv(“userProject.csv”))
.exec { session =>
// fetch project from session
session(“project”).validate[String].map { project =>
// fetch project’s issues
val issues = issuesByProject(project)
val selectedIssue = issues.next()
// inject the issue in the session
session.set(“issue”, selectedIssue)
}
}
`
Regards,
Martin