简体   繁体   English

忽略 Gatling 中的响应体

[英]Ignore response body in Gatling

As part of a load test in Gatling, I download a huge file (about 4GB).作为 Gatling 负载测试的一部分,我下载了一个巨大的文件(大约 4GB)。

When doing so, I can observe the memory usage of Gatling gradually increase, until it hits 2GB, when it stops the download until it times out.这样做时,我可以观察到 Gatling 的 memory 使用量逐渐增加,直到达到 2GB,然后停止下载直到超时。

As I don't care about the response body (as long as it's being downloaded), I'd like to discard it.由于我不关心响应正文(只要它正在下载),我想丢弃它。

How is this possible?这怎么可能?

I'm not sure a code example is useful, but this is the calling exec:我不确定代码示例是否有用,但这是调用 exec:

exec(
  http("Get image data")
    .get("Url/To/Data")
    // Don't save the response body, as it's too large
    // .check(bodyString.saveAs("responseBody"))
    .check(status.is(200))
)

Response body will not be consolidated and will be discarded unless:响应正文将不会合并,将被丢弃,除非:

  • you do use it, eg with a check你确实使用它,例如支票
  • you enable debug logging that causes it to be displayed in the logs您启用调试日志记录,使其显示在日志中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM