- Introduced a new `system_health_constants.py` file to define thresholds and constants for system health metrics. - Refactored existing system health callbacks into modular components, enhancing maintainability and clarity. - Implemented dynamic loading of time range options in `charts.py`, improving flexibility in time range selection. - Added detailed documentation for new callback functions, ensuring clarity on their purpose and usage. - Enhanced error handling and logging practices across the new modules to ensure robust monitoring and debugging capabilities. These changes significantly improve the architecture and maintainability of the system health monitoring features, aligning with project standards for modularity and performance.
30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
"""
|
|
Enhanced system health callbacks for the dashboard.
|
|
"""
|
|
|
|
from dash import callback_context
|
|
|
|
import dash_bootstrap_components as dbc
|
|
from utils.logger import get_logger
|
|
|
|
# Import refactored callback modules
|
|
from dashboard.callbacks.system_health_modules.quick_status_callbacks import register_quick_status_callbacks
|
|
from dashboard.callbacks.system_health_modules.data_collection_callbacks import register_data_collection_callbacks
|
|
from dashboard.callbacks.system_health_modules.database_callbacks import register_database_callbacks
|
|
from dashboard.callbacks.system_health_modules.redis_callbacks import register_redis_callbacks
|
|
from dashboard.callbacks.system_health_modules.system_performance_callbacks import register_system_performance_callbacks
|
|
|
|
logger = get_logger("default_logger")
|
|
|
|
|
|
def register_system_health_callbacks(app):
|
|
"""Register enhanced system health callbacks with comprehensive monitoring."""
|
|
|
|
# Register callbacks from refactored modules
|
|
register_quick_status_callbacks(app)
|
|
register_data_collection_callbacks(app)
|
|
register_database_callbacks(app)
|
|
register_redis_callbacks(app)
|
|
register_system_performance_callbacks(app)
|
|
|
|
logger.info("Enhanced system health callbacks registered successfully") |