diff options
Diffstat (limited to 'api/debug/stats.php')
| -rw-r--r-- | api/debug/stats.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/api/debug/stats.php b/api/debug/stats.php index dd0b0db..6e4feb0 100644 --- a/api/debug/stats.php +++ b/api/debug/stats.php @@ -37,13 +37,20 @@ foreach ($errors as $e) { } } +$totalOccurrences = 0; +foreach ($errors as $e) { $totalOccurrences += (int)($e['count'] ?? 1); } + usort($topErrors, fn($a, $b) => $b['count'] - $a['count']); $topErrors = array_slice($topErrors, 0, 20); ksort($byDay); json_response([ 'success' => true, - 'total_errors' => $total, + // total_errors = OCCURRENCES (sum of counts); unique_errors = distinct signatures. + // Before 2026-10-23 the key held the record count while by_type held occurrences, + // so two numbers on the same screen disagreed by ~3,500x. + 'total_errors' => $totalOccurrences, + 'unique_errors' => $total, 'total_sessions' => count($sessions), 'by_type' => $byType, 'by_severity' => $bySeverity, |