当用户提出以下需求时启用:
.jmx。
JMETER_HOME 或 PATH 中的 jmeter。
result.jtl、JMeter 原生 native-report/ 与自定义精美 HTML 报告。
${TOKEN}、${USER} 等占位符。
scripts/jmx_generator.py。
scripts/run_jmeter.py。
scripts/report_builder.py,必要时同时指向原生 native-report/。
.jmx、JTL/原生报告位置、自定义 HTML 报告、关键指标和风险说明。
{
"name": "order-api-load-test",
"base_url": "https://api.example.com",
"users": 50,
"ramp_up": 120,
"loops": 1,
"duration": 600,
"think_time_ms": 500,
"headers": {"Authorization": "Bearer ${TOKEN}", "Content-Type": "application/json"},
"csv": {"filename": "users.csv", "variables": "USER_ID,TOKEN"},
"requests": [
{"name": "query-order", "method": "GET", "path": "/orders/${USER_ID}", "assertion": {"contains": "orderId"}},
{"name": "create-order", "method": "POST", "path": "/orders", "body": "{\"userId\":\"${USER_ID}\"}", "assertion": {"contains": "success"}}
]
}
生成 JMX:
"$BOX_AGENT_PYTHON" scripts/jmx_generator.py --spec spec.json --out output/test-plan.jmx
执行 JMeter:
"$BOX_AGENT_PYTHON" scripts/run_jmeter.py --jmx output/test-plan.jmx --outdir output/run-001
输出:result.jtl、native-report/、jmeter-run.log。
生成精美报告:
"$BOX_AGENT_PYTHON" scripts/report_builder.py --jtl output/run-001/result.jtl --out output/run-001/summary-report.html --title "性能测试报告"
.jmx 能被 JMeter 5.x 打开或 jmeter -n -t 识别。
详见 references/faq.md。
references/natural-language-routing.md
references/jmx-generation-guide.md
references/execution-guide.md
references/report-guide.md
references/security-and-anti-patterns.md
references/faq.md
references/trace-self-check.md
scripts/jmx_generator.py
scripts/run_jmeter.py
scripts/report_builder.py
共 1 个版本