feat: expose performance collection health (#1671)

This commit is contained in:
Lyon
2026-06-20 09:03:17 +08:00
committed by GitHub
parent 66c5f52939
commit e0127f1044
7 changed files with 524 additions and 13 deletions
@@ -26,6 +26,12 @@ test("performance dashboard renders Chinese charts and keeps drill-down reachabl
await expect(page.locator(".performance-contract-item").filter({ hasText: "样本覆盖" })).toContainText("路由");
await expect(page.locator(".performance-contract-item").filter({ hasText: "数据质量" })).toContainText("低样本阈值 5 个样本");
await expect(page.locator(".performance-contract-item").filter({ hasText: "统计口径" })).toContainText("精确窗口分位");
await expect(page.locator(".performance-collection-item")).toHaveCount(4);
await expect(page.locator(".performance-collection-item").filter({ hasText: "最近样本" })).toContainText("归因字段不完整");
await expect(page.locator(".performance-collection-item").filter({ hasText: "当前窗口样本" })).toContainText("保留");
await expect(page.locator(".performance-collection-item").filter({ hasText: "来源组成" })).toContainText("工作台");
await expect(page.locator(".performance-collection-item").filter({ hasText: "归因完整性" })).toContainText("不完整");
await expect(page.getByText("工作台归因不完整")).toBeVisible();
await expect(page.getByText("工作台体感趋势")).toBeVisible();
await expect(page.getByText("状态分布")).toBeVisible();
await expect(page.getByText("慢 API TopN")).toBeVisible();
@@ -70,6 +76,10 @@ test.describe("performance dashboard empty collection", () => {
await expect(page.getByRole("heading", { name: "性能监控" })).toBeVisible();
await expect(page.locator(".performance-contract-item")).toHaveCount(5);
await expect(page.locator(".performance-contract-item").filter({ hasText: "样本覆盖" })).toContainText("0 样本");
await expect(page.locator(".performance-collection-item")).toHaveCount(4);
await expect(page.locator(".performance-collection-item").filter({ hasText: "最近样本" })).toContainText("采集器尚未上报样本");
await expect(page.locator(".performance-collection-item").filter({ hasText: "当前窗口样本" })).toContainText("0 样本");
await expect(page.getByText("暂无采集样本")).toBeVisible();
await expect(page.getByText("等待数据").first()).toBeVisible();
await expect(page.getByText("暂无性能样本。请先打开工作台或执行一次真实页面操作后刷新。")).toBeVisible();
await expect(page.locator(".performance-row-contract")).toHaveCount(0);