I want to write a gatling load test simulation class. I have three requests req1, req2 and req3. I want to be able to be able to perform a load test with 300 users ramped up over 5 seconds. i also need the test to run for 20 minutes totally.
Now i need the three requests to run simultaneously but with req1 90% throughput, 5% req2 and 5% req3. ex: if there are 100 requests, 90 must be of req1 and 5 of req2 and 5 of req3.
Here is my simulation class so far:
package simulations;
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class LoadSimulation extends Simulation{
val httpConfig = http
.baseURL("http://url.com")
.acceptHeader("text/html,application/xhtml+xml,application/xml")
val update = scenario("Update").exec(Api.update)
val read= scenario("Read").exec(Api.read)
val age= scenario("Age").exec(Api.age)
setUp(
postToChannel.inject(rampUsers(300) over (5 seconds))
).protocols(httpConf)
.maxDuration(20 minutes)
}
object Api{
val channelFeeder = csv(test.csv).random
val update = feed(channelFeeder)
.exec(http("Update")
.get("/update?key=${key}&${url}")
val read= feed(channelFeeder)
.exec(http("Read")
.get("/app/${id}/data/1/1.json?key=${key}")
val age= feed(channelFeeder)
.exec(http("Age")
.get(/app/${id}/data/1/age?key=${key})
}
I'm not sure how to put these three apis in one scenario and run them with update(90), read(5) and age(5) throughputs respectively.
Any leads on this will be helpful.
Thanks