在泊坞窗中使用不带UI的蝗虫分布式模式测试API时。正在生成distribution.csv,requests.csv,但未生成failures.csv和Expection.csv,但request.csv显示失败,如下所示。
"Method","Name","# requests","# failures","Median response time","Average response time","Min response time","Max response time","Average Content Size","Requests/s"
"POST","/api/something/something",197009,56,470,559,78,156714,1,436.31
可以帮忙吗?
答案 0 :(得分:0)
问题在于,需要将文件写入具有权限的文件夹,并将其写入主机。如果在文件名之前添加已安装的文件夹,则该文件夹应该可以使用。例如:
Docker文件:
# Set base image
FROM locustio/locust
ADD locustfile.py locustfile.py
Docker创建命令:
docker build -t mykey/myimage:1.0 .
Docker运行命令(在Windows上,在Linux上用$ pwd替换为%CD%):
docker run --volume "%CD%:/mnt/locust" -e LOCUSTFILE_PATH=/mnt/locust/locustfile.py -e TARGET_URL=https://example.com -e LOCUST_OPTS="--clients=10 --no-web --run-time=600 --csv=/mnt/locust/output" mykey/myimage:1.0
文件现在将写入locustfile.py所在的文件夹。