有什么方法可以随机化 Gatling 中每秒的请求吗?在文档中,他们提供了reachRps和jumpToRps,它们不提供范围内的动态请求。如何设置脚本以在每秒 500 到 1000 的范围内发布请求?
package sample
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class PerformanceTest extends Simulation {
object rqstObj {
val getData =
exec(
http("Get SourceId")
.post(SomeURL)
.body(SomeBody)
.check(status.is(200))
)
}
val rqst = scenario("Test1")
.forever(exec(rqstObj.getData))
setUp(rqst.inject(
constantUsersPerSec(18) during (5 seconds)
).protocols(httpProtocol)).throttle(
//Instead of writing the below code, i need something dynamic as we have for rampUser
reachRps(650) in (1 minute),
reachRps(950) in (1 minute),
reachRps(650) in (1 minute)
).maxDuration(3 minutes)
}