1
0

feat: 动态粒度趋势图,支持 auto bucket 选择 + P95 延迟 + 状态条

This commit is contained in:
2026-05-23 23:53:18 +08:00
parent 6601ab458d
commit 4f33fba793
16 changed files with 315 additions and 106 deletions

View File

@@ -154,9 +154,9 @@ describe("validateDashboardWindow", () => {
});
describe("validateMetricsBucket", () => {
test("默认值bucket=1h", () => {
test("默认值bucket=auto", () => {
const result = validateMetricsBucket(null, "production");
expect(result).toEqual({ bucket: "1h" });
expect(result).toEqual({ bucket: "auto" });
});
test("bucket=1h 返回成功", () => {
@@ -165,7 +165,7 @@ describe("validateMetricsBucket", () => {
});
test("不支持的 bucket 参数返回 400", () => {
const result = validateMetricsBucket("5m", "production");
const result = validateMetricsBucket("invalid", "production");
expect(result).toHaveProperty("status", 400);
});
});