我正在试用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然后使用run命令启动我的脚本(我在Windows上)。
这一点都没有区别,在控制台或生成的报告中都没有发送/接收数据包的跟踪。
有人知道如何让炮兵追踪它在做什么,请求和回应吗?最好添加到报告文件中,但如果有必要,我将单独使用控制台。
发布于 2017-07-31 11:11:54
是从powershell控制台运行的。下降到良好的老CMD和它的工作记录。
发布于 2021-05-11 14:23:06
在上进行了Git Bash终端的测试。
设置调试:
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-02-04 09:46:43
在Powershell中,您必须将环境变量DEBUG设置为例如http:
$Env:DEBUG = "http"您可以按以下方式检查当前值:
$Env:DEBUG请参阅使用和更改环境变量上的Powershell文档。
https://stackoverflow.com/questions/45411701
复制相似问题