Hi, I need help in how to implement a throttle correclty. I’m trying to reach a flat ~4K RPM.
My simulation (v 3.3.1) is set up as
setUp(
runOne.inject(
constantConcurrentUsers(10000) during (55 minutes)
)
.throttle(
reachRps(67) in (5 minute),
holdFor(50 minutes)
)
).protocols(httpProtocol)
.maxDuration(55 minutes)
and runOne includes 2 exec blocks
val runOne = scenario(“1”).exec(request1, request2)
However when I run this only the first request gets executed constantly without the second one being run straight after the first.
What request does the throttle work on?
Hello
Throttling doesnt affect the requests, it just controls the RPS.
regarding the request2 not executing, I tried with the similar way as you did, it works fine for me.
can you pls share the val of request1 and request2 ? so that it will be much easier to identify
Thanks
Sujin Sam
The RPS on what request though? All of them combined? Here are the extra details
val request1: ChainBuilder =
exec(_.set(“ob_authorization”, obAuthorization))
.exec(
http(“OB buildSlip”)
.post(backofficeHost + buildSlipUrl)
.headers(buildSlipHeaders)
.body(ElFileBody(“openbet/buildSlip.json”)).asJson
.check(status.is(200))
.check(jsonPath("$.betslipUid").saveAs(“betslipUid”))
.check(jmesPath(legsJmesPath).saveAs(“legs”))
.check(jmesPath(selectionsJmesPath).saveAs(“selections”))
)
.exec(
session => {
val selections = regex.replaceAllIn(session(“selections”).as[String], “$1”)
session.set(“new_selections”, selections)
}
).pause(1)
val request2: ChainBuilder =
exec(.set(“ob_authorization”, obAuthorization))
.exec(.set(“betType”, “ACC5”))
.exec(
http(“OB PlaceBet”)
.post(backofficeHost + placeBetUrl)
.headers(buildSlipHeaders)
.body(ElFileBody(“openbet/placeBet.json”)).asJson
.check(status.is(200))
.check(jsonPath("$.status").in(“confirmed”, “delay”))
).pause(2)
Throttle controls based on overall requests, not specific
I couldnt find the issue on your code
Hope someone else can help
Thanks
Sujin Sam
Thanks for your help. I’ll continue to play around with this