admin管理员组文章数量:1315826
I am using Artillery with Playwright to measure performance metrics of a website, but I am not getting the metrics I specified in the configuration. Instead, I am seeing only browser-related metrics.
My Artillery Configuration:
import { Page } from "@playwright/test";
export const config = {
target: "",
defaults: {
capture: {
response: ["status_code", "latency"],
metrics: [
"http.response_time.p50",
"http.response_time.p95",
"http.response_time.p99",
"http.response_time.min",
"http.response_time.max",
"http.request_rate",
"http.codes.200",
"http.codes.4xx",
"http.codes.5xx",
],
},
},
plugins: {
expect: { enabled: true },
ensure: {
thresholds: {
"browser.page.TTFB./": { p95: 100 },
"vusers.session_length.min": 1000,
"browser.page.codes.404": 0,
},
},
},
engines: {
playwright: { showAllPageMetrics: false },
},
phases: [{ duration: 10, arrivalRate: 1, name: "Usersarrival" }],
};
export const scenarios = [
{
engine: "playwright",
testFunction: helloWorld,
},
];
export async function helloWorld(page: Page) {
await page.goto("/");
await page.click("text=Docs");
}
I am using Artillery with Playwright to measure performance metrics of a website, but I am not getting the metrics I specified in the configuration. Instead, I am seeing only browser-related metrics.
My Artillery Configuration:
import { Page } from "@playwright/test";
export const config = {
target: "https://www.artillery.io",
defaults: {
capture: {
response: ["status_code", "latency"],
metrics: [
"http.response_time.p50",
"http.response_time.p95",
"http.response_time.p99",
"http.response_time.min",
"http.response_time.max",
"http.request_rate",
"http.codes.200",
"http.codes.4xx",
"http.codes.5xx",
],
},
},
plugins: {
expect: { enabled: true },
ensure: {
thresholds: {
"browser.page.TTFB.https://www.artillery.io/": { p95: 100 },
"vusers.session_length.min": 1000,
"browser.page.codes.404": 0,
},
},
},
engines: {
playwright: { showAllPageMetrics: false },
},
phases: [{ duration: 10, arrivalRate: 1, name: "Usersarrival" }],
};
export const scenarios = [
{
engine: "playwright",
testFunction: helloWorld,
},
];
export async function helloWorld(page: Page) {
await page.goto("https://www.artillery.io/");
await page.click("text=Docs");
}
Issue: I expected to see http.response_time.p50, http.response_time.p95, etc., in my report. However, when I run the test, I only get browser-level metrics:
browser.page.TTFB.https://www.artillery.io/: min: 49.7, max: 111, p95: 63.4 browser.page.FCP.https://www.artillery.io/: min: 348.7, max: 921.8, p95: 528.6 browser.page.codes.200: 580 browser.page.codes.404: 10 vusers.session_length: min: 717.4, max: 2245.9, p95: 1353.1
Can someone please help me with this?
Share Improve this question asked Jan 30 at 4:42 JayzJayz 6543 gold badges11 silver badges34 bronze badges1 Answer
Reset to default 1Setting config.defaults.capture
has no effect as it's not a recognized configuration option for Artillery. (It looks like it was possibly suggested by an AI copilot?)
You're not seeing http.
-prefixed metrics you've defined in that block because Playwright-based tests don't capture those metrics. You can see the list of metrics reported by those tests in the official docs here: https://www.artillery.io/docs/reference/engines/playwright#metrics-reported-by-the-engine
本文标签: load testingArtillery Playwright Not Capturing Specified MetricsStack Overflow
版权声明:本文标题:load testing - Artillery Playwright Not Capturing Specified Metrics - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741985807a2408668.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论