Hi there,
I have one requirement that every request should run in consistent TPS for a whole test.
Below is my code snippet:
val updateLineItemScenarioFromV3: ScenarioBuilder = scenario("Update Line Item Scenario")
.feed(Feeder.tlv4_1EntDetailsV3UptLineChkDate)
.exec(session => {
session.set("accessToken", MessagePasser.getMessage(1))
})
.exec(session => {
val endDate = s"2025-10-10T23:59:59Z"
session.setAll(Map(
"endDate" -> endDate,
))
})
.exec(UpdateLineEndDate).exec(flushHttpCache)
}
And my injection profile:
UpdateEntitlement.updateLineItemScenarioFromV3.inject(constantUsersPerSec(10).during(1 minutes)).throttle(reachRps(10) in (0 seconds),holdFor(1 minutes))
When I execute for 1 minute, I got my requirement of consistently 10 requests per second.
Now, I have to get date from the “getEntitlementById” API and pass it to the “UpdateLineEndDate” API. So, adding one more request in my scenario.
val updateLineItemScenarioFromV3: ScenarioBuilder = scenario("Update Line Item Scenario")
.feed(Feeder.tlv4_1EntDetailsV3UptLineChkDate)
.exec(session => {
session.set("accessToken", MessagePasser.getMessage(1))
})
.exec(getEntitlementById)
.exec(session => {
val endDate = s"${updateLineEndDate}T23:59:59Z"
session.setAll(Map(
"updatedEndDate"-> updateLineEndDate,
"endDate" -> endDate,
))
})
.exec(UpdateLineEndDate).exec(flushHttpCache)
}
And my injection profile:
UpdateEntitlement.updateLineItemScenarioFromV3.inject(constantUsersPerSec(20).during(1 minutes)).throttle(reachRps(20) in (0 seconds),holdFor(1 minutes))
When I re-executed for 1 minute, I observed consistently 20 requests per second.
I also want consistent tps for each API’s:
getEntitlementById - 10 TPS
UpdateLineEndDate - 10 TPS
But for the individual API’s , it got dispread.
I am not sure about the execution behind the scenes. So, please provide me some resolution to reach consistent TPS in each API’s.
Thank You in advance!