Loading...
Loading...
Compare original and translation side by side
gcx apik6-manageresultstatuschecksreferences/worked-example.mdgcx apik6-manageresultstatuschecksreferences/worked-example.mdgcx k6 load-tests update-script-vvv --log-http-payload/test_runsgcx k6 runs list --limit 0@nextLinkgcx apik6-managecreatedcheck()thresholdschecksgcx k6 load-tests update-script-vvv --log-http-payload/test_runsgcx k6 runs list --limit 0@nextLinkk6-managegcx apicreatedcheck()thresholdschecksgcxk6-managegcx --context <stack> config check # expect "✔ Connectivity: online"gcxk6-managegcx --context <stack> config check # 预期输出:"✔ Connectivity: online"/a/k6-app/tests/<id>/a/k6-app/runs/<id>gcx apik6-managegcx --context <stack> api /api/plugins/k6-app/resources/cloud/cloud/v6/test_runs/<run_id>.test_id/a/k6-app/tests/<id>/a/k6-app/runs/<id>gcx apik6-managegcx --context <stack> api /api/plugins/k6-app/resources/cloud/cloud/v6/test_runs/<run_id>.test_idgcx --context <stack> k6 load-tests get <test_id> -o jsonk6-managek6-managek6-managegcx --context <stack> k6 load-tests get <test_id> -o jsonk6-managek6-managek6-managegcx api@nextLinkk6-manage/cloud/v6/load_tests/<test_id>/test_runsall_runsprint(f"Total: {len(all_runs)}")
runs_sorted = sorted(all_runs, key=lambda r: r['created'], reverse=True)
for r in runs_sorted[:10]:
print(f" {r['created']:30s} id={r['id']:>8} status={r['status']:<10} result={r.get('result','?')}")k6-managegcx api@nextLink/cloud/v6/load_tests/<test_id>/test_runsall_runsprint(f"Total: {len(all_runs)}")
runs_sorted = sorted(all_runs, key=lambda r: r['created'], reverse=True)
for r in runs_sorted[:10]:
print(f" {r['created']:30s} id={r['id']:>8} status={r['status']:<10} result={r.get('result','?')}")last7 = [r for r in all_runs if r['created'] >= '<today_minus_7_days_iso>']len(last7) == 0last7 = [r for r in all_runs if r['created'] >= '<today_minus_7_days_iso>']len(last7) == 0| Layer | Field | Meaning |
|---|---|---|
| Run-level outcome | | Whether thresholds breached |
| Run-level status | | Whether the run finished orderly |
| In-script checks | v5 | Per-check success rate |
result: passedcheck()checksabortOnFailk6-manage/references/metrics.mdquery_aggregate_k6gcx --context <stack> api \
"/api/plugins/k6-app/resources/cloud/cloud/v5/test_runs/<run_id>/query_aggregate_k6(query='ratio by (check)',metric='checks')"checkincrease_nz by (check)increase_z by (check)| 维度 | 字段 | 含义 |
|---|---|---|
| 运行级结果 | | 是否有阈值被违反 |
| 运行级状态 | | 运行是否正常完成 |
| 脚本内检查 | v5版本的 | 逐检查的成功率 |
resultpassedcheck()checksabortOnFailquery_aggregate_k6k6-manage/references/metrics.mdgcx --context <stack> api \
"/api/plugins/k6-app/resources/cloud/cloud/v5/test_runs/<run_id>/query_aggregate_k6(query='ratio by (check)',metric='checks')"checkincrease_nz by (check)increase_z by (check)k6-manage/references/metrics.mdundefinedk6-manage/references/metrics.mdundefined
Picking the right query method per metric type matters — see the "Query methods" tables in `k6-manage/references/metrics.md`. For browser tests, the URL/status breakdown comes from `labels` + `label/{name}/values` (metrics.md §4/§5), not from a separate tags endpoint.
根据指标类型选择正确的查询方式至关重要——请查看`k6-manage/references/metrics.md`中的“查询方式”表格。对于浏览器测试,URL/状态的细分信息来自`labels` + `label/{name}/values`(metrics.md第4/5节),而非单独的标签端点。k6-managegcx api/api/plugins/k6-app/resources/logs/...{test_run_id="<id>"}X-K6TestRun-Idstartendrun.createdrun.ended/tmp/run_<id>_logs.jsonk6-managegcx api/api/plugins/k6-app/resources/logs/...{test_run_id="<id>"}X-K6TestRun-Idrun.createdrun.ended/tmp/run_<id>_logs.jsonk6-managek6 inspectContent-Type: application/octet-streamabortOnFail==!=k6-managek6 inspectContent-Type: application/octet-streamabortOnFail==!=Test: <name> (id <test_id>)
Run: <run_id> @ <created> → <ended>, load_zone=<zone>, result=<result>
Logs (<n> streams, <m> lines):
- <stream summary>
Metrics (key indicators):
- <metric>: <method> = <value> (n=<count>)
...
Per-check breakdown:
- <check name>: <success_rate> (succ=<n>, fail=<n>)
...
Diagnosis: <one-paragraph>Question: <one-line restatement of what the user is trying to attribute>
Run timeline (relevant window):
| Run ID | Created (UTC) | Result | exec_duration | processing_duration | k6 build | error code | key check ratios |
|---|---|---|---|---|---|---|---|
| ... | ... | passed | 60s | 195s | <build> | — | 1.0/1.0/1.0 |
| ... | ... | failed | 27s | 193s | <build> | — | 0.0/n=0/n=0 |
| ... | ... | error | 51s | 3601s aborted | <build> | 8016 | 1.0/1.0/1.0 |
Differences that matter:
- <field>: <value-in-passing> vs <value-in-failing> — <interpretation>
...
Script diff (if relevant): <bundled-script diff between a representative passing and failing run, summarised>
Diagnosis: <one-paragraph attributing the change to test-side, SUT-side, or platform-side, with the supporting evidence>/tmp/k6inv/run<id>/测试:<名称>(ID <test_id>)
运行实例:<run_id> @ <created> → <ended>,负载区域=<zone>,结果=<result>
日志(<n>个流,<m>行):
- <流摘要>
指标(关键指标):
- <指标>: <统计方法> = <数值>(样本数=<count>)
...
逐检查详情:
- <检查名称>: <成功率>(成功=<n>,失败=<n>)
...
诊断结论:<一段文字>问题:<用户试图确认的问题的一行概括>
运行时间线(相关时间范围):
| 运行ID | 创建时间(UTC) | 结果 | 执行时长 | 处理时长 | k6构建版本 | 错误码 | 关键检查成功率 |
|---|---|---|---|---|---|---|---|
| ... | ... | passed | 60s | 195s | <build> | — | 1.0/1.0/1.0 |
| ... | ... | failed | 27s | 193s | <build> | — | 0.0/n=0/n=0 |
| ... | ... | error | 51s | 3601s aborted | <build> | 8016 | 1.0/1.0/1.0 |
关键差异:
- <字段>: <通过运行的数值> vs <失败运行的数值> — <解读>
...
脚本差异(若相关):<选取一个代表性的通过运行和失败运行的快照脚本差异,进行摘要>
诊断结论:<一段文字,将变更归因于测试端、被测系统端或平台端,并提供支持证据>/tmp/k6inv/run<id>/check()resultresultcheck()resultresult | Meaning |
|---|---|
| All thresholds passed (or none defined) |
| At least one threshold failed |
| Either the script crashed before finishing (e.g. browser wouldn't launch) or k6 Cloud aborted the run platform-side. To tell which, check |
| User or system aborted the run |
check()resultcheckschecksresult | 含义 |
|---|---|
| 所有阈值均通过(或未定义任何阈值) |
| 至少有一个阈值未通过 |
| 脚本在完成前崩溃(例如,浏览器无法启动)或k6 Cloud平台端终止了运行实例。要区分这两种情况,请检查运行实例的 |
| 用户或系统终止了运行实例 |
check()resultcheckschecksresultchecks{check:response is 200}
✓ 'rate==1.0' rate=0.00% ← ✓ pass!?check()catchtry {
const r = await page.goto(URL);
check(r, { "response is 200": x => x.status() === 200 });
// ... rest of iteration body
check(true, { "script completed without exception": () => true });
} catch (e) {
console.error(e);
check(null, { "script completed without exception": () => false });
} finally {
await page.close();
}'checks{check:script completed without exception}': ['rate==1.0']checks{check:response is 200}
✓ 'rate==1.0' rate=0.00% ← ✓ 通过?check()catchtry {
const r = await page.goto(URL);
check(r, { "response is 200": x => x.status() === 200 });
// ... 迭代体剩余部分
check(true, { "脚本无异常完成": () => true });
} catch (e) {
console.error(e);
check(null, { "脚本无异常完成": () => false });
} finally {
await page.close();
}'checks{check:脚本无异常完成}': ['rate==1.0']abortOnFailabortOnFailWhen k6 runs in the cloud, thresholds are evaluated every 60 seconds. Thefeature may be delayed by up to 60 seconds.abortOnFail
abortOnFailresultfailed当k6在云端运行时,阈值每60秒评估一次。功能可能会延迟最多60秒触发。abortOnFail
abortOnFailresultfailed<><=>===!=raterate==1.0rate==0<><=>===!=rate==1.0rate==0cloud/cloud/X-K6TestRun-Idupdatedgcx k6 runs list --limit 0@nextLinkk6-manage| Symptom | Cause | Fix |
|---|---|---|
| "Latest run was 6 months ago" but schedule says daily | You didn't paginate | Use the |
| "Last 7 days" report contains only old runs | Filtered by row count, not date | Re-filter by |
| Threshold reports ✓ pass but checks fail | Zero check observations; iteration aborted before | See "Threshold semantics" above |
| Likely a platform abort (e.g. | Check |
| Investigating a past run by reading the current load-test script | Script may have been edited since the run executed — what you're reading isn't what ran | GET the run's bundled script via the per-run endpoint ( |
| Just overwrote the user's script | Invoked | Restore from the backup taken in Step 2. To learn URLs without writing, use |
CLI | Overrides scenario block entirely | Edit |
cloud/cloud/X-K6TestRun-Idupdatedgcx k6 runs list --limit 0@nextLinkk6-manage| 症状 | 原因 | 解决方法 |
|---|---|---|
| “最新运行是6个月前”但定时任务设置为每日执行 | 未对 | 使用 |
| “最近7天”报告仅包含旧运行实例 | 按行数过滤而非按日期过滤 | 使用 |
| 阈值显示✓通过但检查失败 | 无检查观测数据;迭代在执行 | 查看上文的“阈值语义”部分 |
| 可能是平台端终止(例如, | 检查运行实例的 |
| 通过读取当前负载测试脚本分析过去的运行实例 | 脚本可能在运行实例执行后被编辑——你读取的并非实际运行的脚本 | 通过运行实例专属端点获取该运行的快照脚本( |
| 刚刚覆盖了用户的脚本 | 调用 | 从步骤2中创建的备份恢复脚本。若要在不写入的情况下了解URL,请在任何非变更命令后添加 |
CLI参数 | 完全覆盖了场景配置块 | 使用sed在文件中编辑 |
references/worked-example.mdreferences/worked-example.md