【发布时间】:2019-05-02 08:30:33
【问题描述】:
我正在使用以下 gatling3 代码测试我的 API
setUp(scn.inject(constantUsersPerSec(300) during (10 minutes))).throttle(
reachRps(300) in (10 seconds),
holdFor(5 minutes),
reachRps(500) in (10 seconds),
holdFor(5 minutes)
).protocols(httpProtocol)
我期望在前 5 分钟内,gatling 每秒发送 300 个请求,在接下来的 5 分钟内,gatling 每秒发送 500 个请求。但是测试报告显示,gatling 在这 10 分钟内每秒发送 300 个请求。
为什么会这样?
【问题讨论】:
-
每个用户都发送 1 个请求吗? Throttle 会限制最大发送请求,但不能保证最小,因此如果这 300 个恒定用户/秒仅发送 300 个请求/秒,那么每秒不可能达到 500 个请求。
标签: performance gatling