Artillery:如何按顺序运行场景并将每个场景的结果显示在同一个文件中?
我目前正在编写 nodejs 测试artillery.io
来比较我实现的两个端点之间的性能。我定义了两个场景,我想在同一个报告文件中获得每个场景的结果。测试的执行不是顺序的,这意味着在测试结束时我已经组合了一个结果,不可能知道每个测试的性能,但只能知道所有测试的性能。
config:
target: "http://localhost:8080/api/v1"
plugins:
expect: {}
metrics-by-endpoint: {}
phases:
- duration: 60
arrivalRate: 2
environments:
dev:
target: "https://backend.com/api/v1"
phases:
- duration: 60
arrivalRate: 2
scenarios:
- name: "Nashhorn"
flow:
- post:
url: "/casting/nashhorn"
auth:
user: user1
pass: user1
json:
body:
fromFile: "./casting-dataset-01-as-input.json"
options:
filename: "casting_dataset"
conentType: "application/json"
expect:
statusCode: 200
capture:
regexp: '[^]*'
as: 'result'
- log: 'result= {{result}}'
- name: "Nodejs"
flow:
- post:
url: "/casting/nodejs"
auth:
user: user1
pass: user1
json:
body:
fromFile: "./casting-dataset-01-as-input.json"
options:
filename: "casting_dataset"
conentType: "application/json"
expect:
statusCode: 200
capture:
regexp: '[^]*'
as: 'result'
- log: 'result= {{result}}'
如何按顺序运行场景并将每个场景的结果显示在同一个文件中?
预先感谢您的回答