Let's say I have this configuration
val scn = (name: String) => scenario(name)
.forever() {
.exec(request)
}
setUp(
scn("scn1").inject(atOnceUsers(1))
.throttle(
jumpToRps(1), holdFor(10 seconds)
),
scn("scn2").inject(atOnceUsers(1))
.throttle(jumpToRps(1), holdFor(20 seconds))
).protocols(http.baseURLs(url))
I would expect to run the whole simulation for 20 seconds - until all is finished. What actually happens is that the simulation is stopped after 10 seconds, right after the first scenario finishes.
---- Requests ------------------------------------------------------------------
> Global (OK=20 KO=0 )
> scn1 / HTTP Request (OK=10 KO=0 )
> scn2 / HTTP Request (OK=10 KO=0 )
---- scn1 ----------------------------------------------------------------------
[--------------------------------------------------------------------------] 0%
waiting: 0 / active: 1 / done:0
---- scn2 ----------------------------------------------------------------------
[--------------------------------------------------------------------------] 0%
waiting: 0 / active: 1 / done:0
================================================================================
Simulation foo.Bar completed in 10 seconds
To overcome this in general, I need to configure all scenarios that ends earlier then the final one to wait with zero throttle.
setUp(
scn.inject(atOnceUsers(1))
.throttle(
jumpToRps(1), holdFor(10 seconds),
jumpToRps(0), holdFor(10 seconds) // <-- added wait
),
scn.inject(atOnceUsers(1))
.throttle(jumpToRps(1), holdFor(20 seconds))
).protocols(http.baseURLs(url))
Is this expected behavior? What other options do I have to make my simulation run until all scenarios are finished or until maxDuration
?
--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
prepare:
http_request = repeat forever
run:
inject N users at once
for step i 1..total_steps
jump to rps (step_size * step)
hold for N seconds
(1 to totalSteps).map(step => {
defaultScenario(loadStepName(step))
.inject(
nothingFor(startTime(step)),
atOnceUsers(concurrency)
)
.throttle(
jumpToRps(0),
holdFor(startTime(step)),
jumpToRps(rps(step)),
holdFor(holdStepForSec),
jumpToRps(0),
holdFor(theRest)
)
}).toList
jumpToRps(0),
holdFor(theRest) // huge time
setUp(
warmupScenario
.inject(
atOnceUsers(concurrency / warmupCoeff),
)
.throttle(
stepThrottling(stepSize / warmupCoeff, holdStepForSec / warmupCoeff, maxRps / warmupCoeff)
:+ jumpToRps(0)
:+ holdFor(theRest)
)
+: loadScenarios()
).protocols(http.baseURLs(url))
.assertions(
assertLoadScenarios()
:+ (global.responseTime.percentile3 lt SLO_LATENCY)
:+ (global.failedRequests.percent lt SLO_MAX_FAILURES_PCT)
:+ (global.allRequests.count is maxRequestCount * remoteHosts)
)
.maxDuration(warmupTime + loadTime)
def warmupScenario() = scenario("Warming Up")
.feed(replayFileFeeder.circular)
.forever() {
group("Warming Up") {
exec(emptyHttpRequest.silent)
}
}
def defaultScenario(name: String) = scenario(name)
.feed(replayFileFeeder.circular)
.forever() {
group(name) {
exec(emptyHttpRequest)
}
}
def loadScenarios(): List[PopulationBuilder] = {
val totalSteps = maxRps / stepSize
val startTime = (step: Int) => warmupTime + ((step - 1) * holdStepForSec)
val rps = (step: Int) => step * stepSize
(1 to totalSteps).map(step => {
defaultScenario(loadStepName(step))
.inject(
nothingFor(startTime(step)),
atOnceUsers(concurrency)
)
.throttle(
jumpToRps(0),
holdFor(startTime(step)),
jumpToRps(rps(step)),
holdFor(holdStepForSec),
jumpToRps(0),
holdFor(theRest)
)
}).toList
}
def assertLoadScenarios(): List[Assertion] = {
val totalSteps = maxRps / stepSize
(1 to totalSteps).map(step => details(loadStepName(step)).responseTime.percentile3 lt SLO_LATENCY).toList
}
def stepThrottling(stepSize: Int, holdStepForSec: Int, maxRps: Int): List[ThrottleStep] = {
(1 to (maxRps / stepSize)).toList.flatMap(step => List(jumpToRps(step * stepSize), holdFor(holdStepForSec seconds)))
}
def loadStepName(step: Int): String = {
s"Load Step #${step} [ rps: ${step * stepSize} ]"
}