17

I'm trying out Artillery.io (http://artillery.io) as a load and performance tool, but I can't seem to get the debugging working.

I'm seeing the output and reports get generated, but for certain HTTP responses (404/401/500.x) I want to see the packets sent and responses received retrospectively.

The documentation at https://artillery.io/docs/debugging.html#logging-everything says that I can run

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

and then launch my script using the run command (I'm on Windows).

This makes no difference at all, there is no tracing of packets sent/received in either the console or the generated report.

Anyone know how to get artillery to trace out what its doing, request by request and response? Preferably added to the report file, but I'll take console alone if I have to.

4

4 回答 4

4

正在从 powershell 控制台运行它。下拉到良好的旧 CMD 并按记录工作。

于 2017-07-31T11:11:54.200 回答
2

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

对于炮兵 v1 ,请参阅文档

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 
于 2021-05-11T14:23:06.790 回答
0

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

$Env:DEBUG = "http"

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

$Env:DEBUG

请参阅有关使用和更改环境变量的 Powershell 文档。

于 2021-02-04T09:46:43.890 回答
-1

更新:看起来 http 调试已更改。有关修订的调试文档,请参阅https://artillery.io/docs/examples/#debugging-http-tests

于 2020-05-29T17:09:50.683 回答