refactor: 移除 success 字段,简化为 matched 单层判定模型
This commit is contained in:
11
README.md
11
README.md
@@ -181,7 +181,7 @@ targets:
|
||||
|
||||
**RecentSample**: `timestamp`、`durationMs`、`up`
|
||||
|
||||
**CheckResult**: `timestamp`、`success`、`matched`、`durationMs`、`statusDetail`、`failure`
|
||||
**CheckResult**: `timestamp`、`matched`、`durationMs`、`statusDetail`、`failure`
|
||||
|
||||
**CheckFailure**: `kind`(error/mismatch)、`phase`、`path`、`expected`、`actual`、`message`
|
||||
|
||||
@@ -245,12 +245,13 @@ bun run verify
|
||||
|
||||
## 目标状态判定
|
||||
|
||||
两层判定模型,适用于 HTTP 和 Command 两种类型:
|
||||
单层判定模型,适用于 HTTP 和 Command 两种类型:
|
||||
|
||||
- **success**: 拨测是否成功完成(HTTP 收到响应 / Command 正常退出)
|
||||
- **matched**: 是否符合 expect 规则(无 expect 时默认为 true)
|
||||
- **UP** = success AND matched
|
||||
- **DOWN** = NOT success OR NOT matched
|
||||
- **UP** = matched
|
||||
- **DOWN** = NOT matched
|
||||
|
||||
执行失败(网络错误、超时、进程崩溃)和 expect 不匹配都统一为 `matched=false`,通过 `failure.kind` 区分(`"error"` vs `"mismatch"`)。
|
||||
|
||||
## 已知限制
|
||||
|
||||
|
||||
Reference in New Issue
Block a user