1
0

feat: 重构为多类型 checker 通用框架,支持 HTTP 与命令检查

- 引入 typed target 判别联合,支持 http 与 command 两种 checker
- expect 重构为有序规则数组,按配置顺序快速失败并生成结构化 failure
- 新增 command runner,支持 exec + args 本地命令执行
- 引入全局并发限制 maxConcurrentChecks 和 size 解析 (KB/MB/GB)
- HTTP/command 各自独立 expect pipeline,应用领域默认成功语义
- SQLite schema、API、Dashboard 全链路调整为 checker 通用契约
- 补充完整测试覆盖(192 tests),更新 README 与示例配置
This commit is contained in:
2026-05-10 22:25:21 +08:00
parent 599d973cbd
commit b8810f1182
46 changed files with 3562 additions and 1062 deletions

View File

@@ -15,15 +15,15 @@ export interface SummaryResponse {
total: number;
up: number;
down: number;
avgLatencyMs: number | null;
avgDurationMs: number | null;
lastCheckTime: string | null;
}
export interface TargetStatus {
id: number;
name: string;
url: string;
method: string;
type: string;
target: string;
interval: string;
latestCheck: CheckResult | null;
stats: TargetStats;
@@ -33,22 +33,31 @@ export interface TargetStatus {
export interface TargetStats {
totalChecks: number;
availability: number;
avgLatencyMs: number | null;
p99LatencyMs: number | null;
avgDurationMs: number | null;
p99DurationMs: number | null;
}
export interface CheckResult {
timestamp: string;
success: boolean;
statusCode: number | null;
latencyMs: number | null;
error: string | null;
matched: boolean;
durationMs: number | null;
statusDetail: string | null;
failure: CheckFailure | null;
}
export interface CheckFailure {
kind: "error" | "mismatch";
phase: string;
path: string;
expected?: unknown;
actual?: unknown;
message: string;
}
export interface TrendPoint {
hour: string;
avgLatencyMs: number | null;
avgDurationMs: number | null;
availability: number;
totalChecks: number;
}