I want to setup Gatling so that in one setup, I can send 3000 requests, of which 95% will use one test file, and 5% another test file. These files are retrieved as json files (called 'userFeeder' in below code. Can Gatling support the above scenario?
The code is currently as follows, which works for a request per second approach, but needs amending.
class AddUserSimulation extends Simulation {
private val conf = ConfigFactory.load() //loads a setup file of parameters
private val TOKEN_VALUE = "tokenvalue"
private val userFeeder = jsonFile("/" + conf.getString("environment") + "/testaddUser.json")
val httpConf = http
.baseURL(conf.getString("api.gateway.url")) // Here is the root for all relative URLs
.header("Referer", conf.getString("referer"))
.header("Cache-Control", "no-cache")
.contentTypeHeader("application/json")
val Login = new ADFSAuthentication Login
val scnAPI = scenario("test add User") // A scenario is a chain of requests and pauses
.feed(userFeeder.circular)
.exec(Login.process)
.repeat(conf.getInt("repeat.count")) {
exec(http("test add User")
.post("/" + conf.getString("environment") + "/users/")
.body(StringBody("${payload}")).asJSON
.header("Authorization", "Bearer ${"+TOKEN_VALUE+"}")
.check(status.is(200)))
.pause(conf.getInt("execution.pause"))
}
setUp(scnAPI.inject(constantUsersPerSec(11) during(30 minutes)).protocols(httpConf))
}
Any help is greatly appreciated.