fix: align performance summary problem counts (#1703)

This commit is contained in:
Lyon
2026-06-20 13:49:10 +08:00
committed by GitHub
parent bd4bc1fa36
commit d2e147c019
2 changed files with 25 additions and 1 deletions
+2 -1
View File
@@ -1298,6 +1298,7 @@ function summaryProblemForRow(row: PerformanceSummaryRow, p95: number, count: nu
}
function isPerformanceProblemRow(row: PerformanceSummaryRow) {
if ((row.kind === "workbench_journey" || row.kind === "workbench_event_phase" || row.kind === "workbench_backend_event_visible") && row.sampleState !== "ok") return false;
return row.tone === "blocked" || row.tone === "warn" || row.outcome !== "ok" || row.statusClass === "network" || row.statusClass === "5xx" || row.statusClass === "4xx";
}
@@ -1508,8 +1509,8 @@ function performanceProblem(labels: Record<string, string>, p95: number, count:
function workbenchProblem(outcome: string, metric: string, count: number, tone: string) {
if (count <= 0) return "no-sample";
if (outcome !== "ok") return outcome;
if (count < LOW_SAMPLE_THRESHOLD) return "low-sample";
if (outcome !== "ok") return outcome;
if (tone === "blocked" || tone === "warn") return `slow-${metric}`;
return "ok";
}