From ab030dce7f80af053faef4fa1d77ca5610de10ed Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Fri, 3 Apr 2026 14:50:51 +0200 Subject: [PATCH] fix crash rate: only count exception crashes, not hard/reboot kills Hard kills and reboot kills are expected during enrollment (reboots, process termination) and should not inflate the crash rate. Only exception crashes represent actual failures. UI updated to visually separate expected exits. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Services/PlatformMetricsService.cs | 3 +-- .../metrics/sections/SectionAgentMetrics.tsx | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Backend/AutopilotMonitor.Functions/Services/PlatformMetricsService.cs b/src/Backend/AutopilotMonitor.Functions/Services/PlatformMetricsService.cs index 8c8c0166..13c48fae 100644 --- a/src/Backend/AutopilotMonitor.Functions/Services/PlatformMetricsService.cs +++ b/src/Backend/AutopilotMonitor.Functions/Services/PlatformMetricsService.cs @@ -275,10 +275,9 @@ namespace AutopilotMonitor.Functions.Services } } - var crashCount = metrics.ExceptionCrashes + metrics.HardKills; var nonFirstRuns = metrics.TotalStarts - metrics.FirstRuns; metrics.CrashRatePercent = nonFirstRuns > 0 - ? Math.Round((double)crashCount / nonFirstRuns * 100, 1) + ? Math.Round((double)metrics.ExceptionCrashes / nonFirstRuns * 100, 1) : 0; metrics.TopExceptions = exceptionCounts diff --git a/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionAgentMetrics.tsx b/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionAgentMetrics.tsx index 83ccbe29..ae706d2f 100644 --- a/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionAgentMetrics.tsx +++ b/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionAgentMetrics.tsx @@ -629,14 +629,14 @@ export function SectionAgentMetrics() { {/* Crash Rate */}
-

Agent Crash Rate

+

Agent Exit Statistics

{crashRate && crashRate.totalStarts > 0 ? (
{crashRate.crashRatePercent.toFixed(1)}% - crash rate + exception crash rate
@@ -647,16 +647,16 @@ export function SectionAgentMetrics() { Exception crashes 0 ? 'text-red-600' : 'text-gray-400'}`}>{crashRate.exceptionCrashes}
-
- Hard kills - 0 ? 'text-orange-600' : 'text-gray-400'}`}>{crashRate.hardKills} +
+ Hard kills (expected) + 0 ? 'text-gray-500' : 'text-gray-400'}`}>{crashRate.hardKills}
- Reboot kills - 0 ? 'text-blue-500' : 'text-gray-400'}`}>{crashRate.rebootKills ?? 0} + Reboot kills (expected) + 0 ? 'text-gray-500' : 'text-gray-400'}`}>{crashRate.rebootKills ?? 0}
- First runs + First runs {crashRate.firstRuns}