scala - 在 Gatling 中请求超时

标签 scala maven gatling

我正在使用 maven 运行我的 Gatling (Scala) 性能测试。

当我将用户从 100 增加到 150 时,它给了我请求超时问题。

如果我将用户数设置为 300,则会在模拟日志中出现以下错误。

// Gatling scenario injection
val scn =  scenario("UATEnvironmentTest")
.exec(http("AdminLoginRequest")
.post("/authorization_microservice/oauth/token")
.headers(headers_1).body(RawFileBody("Login.txt"))
.check(jsonPath("$.access_token")
.saveAs("auth_token")))
.pause(2)  

setUp(scn.inject(nothingFor(5 seconds),atOnceUsers(50),rampUsers(250) over(10 seconds))).protocols(httpProtocol)  

Error :- j.u.c.TimeoutException: Read timeout to /IP:80 after 120000 ms GROUP Failed to build request Request_1: No attribute named 'auth_token' is defined



以下是配置:
//Maven configuration-pom.xml
java.version 1.8
gatling.version 2.2.3
gatling-plugin.version 2.2.1
scala-maven-plugin.version 3.2.2
// Gatling.conf file
connectTimeout 120000                         
handshakeTimeout 120000                       
pooledConnectionIdleTimeout 120000                  
readTimeout 120000                             
requestTimeout 120000                

最佳答案

对于您的特定情况,错误是@user666 在评论部分已经提到的错误,但是如果您想增加 Gatling 脚本的请求时间,以便保持连接:

  • 编辑 Gatling.conf 文件
  • 取消注释 requestTimeout 行
  • 提供您希望连接保持事件的时间(以毫秒为单位)
  • 关于scala - 在 Gatling 中请求超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47730392/

    相关文章:

    Scala Actor 和 worker

    java - 我可以选择我在 Maven 依赖项中使用的唯一包来在 Eclipse 中导出可运行的 jar 吗?

    testing - 以编程方式执行 Gatling 测试

    Scala Shapeless - 迭代/读取 Generic.Repr 的每个项目或将其转换为 HList

    Scala:如何将 `MatchesRegex` 细化与包含反引号的正则表达式(细化库)一起使用?

    maven - 莱宁根等效于 maven 依赖项 `type` 元素

    cookies - 使用 Gatling 工具管理 jsessionid cookie

    jmeter - 负载测试专业人​​员可以通过哪些测量来评估特定负载下每个请求的性能?

    scala - 在 Map 对象上应用方法?

    maven 在我的存储库中找不到原型(prototype)