It’s hard to read, because we cannot know what is this ScenarioList
As I understand your code, ScenarioList
is a Map[String, Int]
val injections = List(
ScenarioList.get("queryPerson").map(defaultUsers => personScenario.inject(atOnceUsers(defaultUsers + additionalUsers)).throttle(
reachRps(defaultUsers) in (5 seconds),
holdFor(t_holdFor seconds))),
ScenarioList.get("queryCompanies").map(defaultUsers => CompanyScenario.inject(atOnceUsers(defaultUsers + additionalUsers)).throttle(
reachRps(defaultUsers) in (5 seconds),
holdFor(t_holdFor seconds))),
ScenarioList.get("queryScoops").map(defaultUsers => scoopScenario.inject(atOnceUsers(defaultUsers + additionalUsers)).throttle(
reachRps(defaultUsers) in (5 seconds),
holdFor(t_holdFor seconds))),
ScenarioList.get("queryOppAlerts").map(defaultUsers => oppAlertsScenario.inject(atOnceUsers(defaultUsers + additionalUsers)).throttle(
reachRps(defaultUsers) in (5 seconds),
holdFor(t_holdFor seconds)))
).flatten
What is visible, now, is that for each scenario name, you apply the same thing
val scenarioByName: Map[String, ScenarioBuilder] = Map(
"queryPerson" -> personScenario,
"queryCompanies" -> CompanyScenario,
"queryScoops" -> scoopScenario,
"queryOppAlerts" -> oppAlertsScenario
)
val injectionNames = List("queryPerson", "queryCompanies", "queryScoops", "queryOppAlerts")
val injections = for {
name <- injectionNames
scn = scenarioByName(name)
defaultUsers <- ScenarioList.get(name)
} yield scn.inject(atOnceUsers(defaultUsers + additionUsers))
.throttle(
reachRps(defaultUsers) in 5.seconds,
holdFor(t_holdFor seconds)
)
So, the only interesting part for your request is:
scn.inject(atOnceUsers(150))
.throttle(
reachRps(100) in 5.seconds,
holdFor(10.minutes)
)
Now, we can answer your initial question:
You can enhance the last throttle, to add more steps, like so:
scn.inject(atOnceUsers(150))
.throttle(
reachRps(5) in 1.seconds,
holdFor(10.minutes),
reachRps(10) in 1.seconds,
holdFor(10.minutes),
reachRps(20) in 1.seconds,
holdFor(10.minutes),
)
Cheers!