【问题标题】:What is gatling's "inferHtmlResources" resource limits?gatling 的“inferHtmlResources”资源限制是什么?
【发布时间】:2019-04-02 08:14:07
【问题描述】:

问题

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)

【问题讨论】:

    标签: scala performance-testing load-testing gatling


    【解决方案1】:

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

    【讨论】:

    • 已经做了很多搜索,但没有遇到这个问题。估计是我的错。感谢分享(采纳为答案)
    猜你喜欢
    • 2010-12-20
    • 2019-06-18
    • 2018-07-12
    • 1970-01-01
    • 2011-06-17
    • 1970-01-01
    • 2010-09-14
    • 1970-01-01
    • 2013-04-19
    相关资源
    最近更新 更多