【问题标题】:Artillery.IO Logging and DebuggingArtillery.IO 日志记录和调试
【发布时间】:2017-07-31 09:09:20
【问题描述】:

我正在尝试将 Artillery.io (http://artillery.io) 作为负载和性能工具,但我似乎无法进行调试。

我看到了生成的输出和报告,但对于某些 HTTP 响应 (404/401/500.x),我希望查看发送的数据包和回溯收到的响应。

https://artillery.io/docs/debugging.html#logging-everything 的文档说我可以运行

set DEBUG=http,http:capture,http:response

然后使用运行命令启动我的脚本(我在 Windows 上)。

这根本没有区别,在控制台或生成的报告中都没有跟踪发送/接收的数据包。

有人知道如何让大炮追踪它在做什么,逐个请求和响应吗?最好添加到报告文件中,但如果必须,我会单独使用控制台。

【问题讨论】:

  • 您好,问这个问题已经一年半了,但我开始面临这个问题(我也在 Windows 上)。您能否描述您为解决此问题而执行的步骤?
  • 嗨凯尔 - 在我的例子中,我试图从 PowerShell 运行它。如果我从 Windows 上的普通 CMD 提示终端或 Mac/Nix 上的终端运行,它工作正常。这些设置是环境变量,所以如果你必须使用 PowerShell,Peng Tuck Kwok 在下面的解决方案中的评论也可以。
  • debugging.html 页面好像被替换了。新链接是artillery.io/docs/examples/#debugging-http-tests

标签: load artillery


【解决方案1】:

Git Bash 终端中的 Windows 上测试。

设置调试:

 export DEBUG=http,http:capture,http:response

测试:

 echo $DEBUG

为测试运行脚本

对于 炮兵 v2

创建文件script.yml

config:
  target: "https://httpbin.org/"
  phases:
    - duration: 3
      arrivalRate: 1
scenarios:
  - name: "Get"
    flow:
      - get:
          url: "/get"

运行它:artillery run script.yml

对于Artillery v1,请参阅docs

artillery quick -c 1 -n 1 https://httpbin.org/get

调试响应:

Started phase 0, duration: 1s @ 16:20:02(+0200) 2021-05-11
/   http request: {
  "url": "https://httpbin.org/get",
  "method": "GET",
  "headers": {
    "user-agent": "Artillery (https://artillery.io)"
  }
} +0ms
  http:response {
  http:response   "date": "Tue, 11 May 2021 14:20:03 GMT",
  http:response   "content-type": "application/json",
  http:response   "content-length": "254",
  http:response   "connection": "keep-alive",
  http:response   "server": "gunicorn/19.9.0",
  http:response   "access-control-allow-origin": "*",
  http:response   "access-control-allow-credentials": "true"
  http:response } +1ms
  http:response "{\n  \"args\": {}, \n  \"headers\": {\n    \"Host\": \"httpbin.org\", \n    \"User-Agent\": \"Artillery (https://artillery.io)\", \n    \"X-Amzn-Trace-Id\": \"Root=1-609a9293-031b2371069a353d0cbb4131\"\n  }, \n  \"origin\": \"213.76.55.123\", \n  \"url\": \"https://httpbin.org/get\"\n}\n" +1ms
Report @ 16:20:04(+0200) 2021-05-11 

【讨论】:

    【解决方案2】:

    从 powershell 控制台运行它。下拉到良好的旧 CMD 并按文档说明工作。

    【讨论】:

    • 如果你在 PowerShell 中,你可以这样做:$Env:DEBUG="DEBUG=http,http:capture,http:response"
    【解决方案3】:

    更新:看起来 http 调试已更改。修改后的调试文档见https://artillery.io/docs/examples/#debugging-http-tests

    【讨论】:

    • 为我链接 404
    【解决方案4】:

    在 Powershell 中,您必须将环境变量 DEBUG 设置为例如 http,如下所示:

    $Env:DEBUG = "http"
    

    您可以按如下方式检查当前值:

    $Env:DEBUG
    

    请参阅Using and changing environment variables 上的 Powershell 文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 2015-05-02
      • 2011-03-26
      • 2015-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多