文件
hyb-oa/docs/ops/dora-metrics.md
T

50 行
1.2 KiB
Markdown
原始文件 Blame 文件历史

此文件含有模棱两可的 Unicode 字符
此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。
# DORA 指标(CFR)落地说明(P13-7)
更新时间:2026-02-12
## 指标口径
- `run_cfr = failed_runs / total_runs`
- `commit_cfr = failed_commits / total_commits`
- `failed_commit` 判定:
1. 对应回归 run 失败;或
2. 该 commit 在回归时间后 24 小时内出现热修记录。
## 数据输入
- 回归 JSON:来自 `server/scripts/regression-all.sh --json-report`
- 可选热修 CSV:`commit_sha,occurred_at`
## 生成命令
```bash
python3 scripts/cfr_report.py \
--input-dir artifacts/regression \
--window 7d,30d \
--output-json /tmp/cfr.json \
--output-md /tmp/cfr.md
```
带热修记录:
```bash
python3 scripts/cfr_report.py \
--input-dir artifacts/regression \
--window 30d \
--hotfix-csv data/hotfix-events.csv \
--output-json /tmp/cfr.json
```
## 输出结构(JSON)
- `generated_at`
- `input_dir`
- `reports_scanned`
- `hotfix_events`
- `windows.<Nd>.{total_runs,failed_runs,run_cfr,run_cfr_pct,total_commits,failed_commits,commit_cfr,commit_cfr_pct}`
## 使用建议
- 周报使用 `7d`,月报使用 `30d`。
- 当 `commit_cfr_pct` 持续高于阈值(例如 15%)时,暂停高风险灰度并补回归样本。