Skip to content

Commit 9f714a6

Browse files
author
Jens Luedicke
committed
Fix System Health.
1 parent eb3b063 commit 9f714a6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

models/system.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def get_system_health_summary():
158158
if severity in summary:
159159
summary[severity] = count
160160

161+
# Calculate total before adding status
162+
total_events = summary['critical'] + summary['error'] + summary['warning'] + summary['info']
163+
161164
# Determine overall health status
162165
if summary['critical'] > 0:
163166
summary['status'] = 'critical'
@@ -168,7 +171,7 @@ def get_system_health_summary():
168171
else:
169172
summary['status'] = 'healthy'
170173

171-
summary['last_24h_total'] = sum(summary.values()) - (1 if 'status' in summary else 0)
174+
summary['last_24h_total'] = total_events
172175

173176
return summary
174177

0 commit comments

Comments
 (0)