什么是 gatling 的 "inferHtmlResources" 资源限制?

What is gatling's "inferHtmlResources" resource limits?

问题

Gatling 脚本当前在 14 个请求时停止,并且不会在场景中继续迭代。不明白为什么...

背景 // 设置

我有一组页面在 Gatling 中测试成功,直到我需要将静态资产移动到新的子域中。

在第一阶段,为了评估新服务器的容量,第一步是通过重定向 (301) 到新域 - 我们称之为 assets.testdomain.com(是的,我们我知道这不是理想的方法 - 这样做是为了允许在不更改后端代码的情况下继续工作)。

应用上述更改后,我们的大部分页面在负载测试时停止迭代,并会在 14 个请求时停止(HTML 请求 + 13 css,js和图片资源).

我们注意到 Gatling 按预期遵循重定向,并且如果页面中包含少量资产,则没有观察到任何问题(场景按预期运行)。

加特林机脚本

这是我的脚本的总体大纲:

  val httpProtocol = http
    .baseURL("https://www.testdomain.com")
    .inferHtmlResources(BlackList(), WhiteList("https://.*.testdomain.com.*."))
    .acceptHeader("image/webp,image/apng,image/*,*/*;q=0.8")
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("en-US,en;q=0.9")
    .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36")

  val SamplePage_0 = Map(
    "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "Upgrade-Insecure-Requests" -> "1")

  val test_duration = 4 minute
  val pacing = 0 second
  val think_time = 10 second

  val SamplePage = scenario("SamplePage")

    .during(test_duration) {
      pause(pacing)
        .repeat(28) {
          pause(think_time)
            .exec(flushHttpCache)
            .group("SamplePage") {
              exec(http("request_0")
                .get("/samplepage")
                .headers(SamplePage_0))
            }
        }
    }

  setUp(
    SamplePage.inject(rampUsers(1) over (1 minute)),
  ).protocols(httpProtocol)

已知问题,已在 Gatling 3 中修复:https://github.com/gatling/gatling/issues/3449