getHealthStatus method
Get health status for monitoring
Implementation
Map<String, dynamic> getHealthStatus() {
final stats = getMemoryStats();
final errorRate =
_notificationCount == 0 ? 0.0 : _errorCount / _notificationCount;
return {
'status': _getHealthLevel(stats, errorRate),
'memoryPressure': stats['memoryPressure'],
'errorRate': '${(errorRate * 100).toStringAsFixed(2)}%',
'recommendations': _getRecommendations(stats, errorRate),
};
}