![]() |
MySQL 26.10.0
Source Code Documentation
|
Own the objects used by one Health Monitor component instance. More...
#include <health_monitor.h>
Public Member Functions | |
| const char * | name () const |
| const char * | sysvar_prefix () const |
| void | set_server_shutting_down (bool shutdown) |
| Notify all Collectors that the server is shutting down and to stop work immediately. More... | |
| bool | initialized () const |
Static Public Member Functions | |
| static mysql_service_status_t | component_init () |
| Create the component owner before publishing any of its objects to callbacks. More... | |
| static mysql_service_status_t | component_deinit () |
| Stop workers and unregister callbacks before destroying the component owner. More... | |
| static Health_Monitor * | instance () noexcept |
| static Disk_Collector * | disk_collector () noexcept |
| static Disk_Forecaster * | disk_forecaster () noexcept |
| static Memory_Collector * | memory_collector () noexcept |
| static System_Collector * | system_collector () noexcept |
| static Log * | log () noexcept |
| static Periodic_Reporter * | periodic_reporter () noexcept |
| static Status_vars * | status_vars () noexcept |
| static Supervisor * | supervisor () noexcept |
| static Tables * | tables () noexcept |
| static Triggered_Reporter * | memory_reporter () noexcept |
| static int | system_vars_update () |
| Notify collectors of pending system variable updates. More... | |
| static bool | available () noexcept |
| The Health Monitor is available if it is initialized and the server is not shutting down. More... | |
Private Member Functions | |
| Health_Monitor () | |
| ~Health_Monitor () | |
| Health_Monitor (const Health_Monitor &)=delete | |
| Health_Monitor & | operator= (const Health_Monitor &)=delete |
| Health_Monitor (Health_Monitor &&)=delete | |
| Health_Monitor & | operator= (Health_Monitor &&)=delete |
| mysql_service_status_t | initialize () |
| Health monitor initialization: More... | |
| mysql_service_status_t | deinitialize () |
| Health monitor deinitialization. More... | |
| int | collectors_init () |
| Initialize the Health Monitor collectors. More... | |
| int | collectors_deinit () |
| Deinitialize the Health Monitor collectors. More... | |
| int | collectors_start () |
| Start the Health Monitor collectors. More... | |
| int | collectors_stop () |
| Shut down the collectors. More... | |
| int | log_init () |
| Initialize the log manager. More... | |
| int | log_deinit () |
| Deinitialize the log manager. More... | |
| int | reporters_init () |
| Initialize the report manager. More... | |
| int | reporters_deinit () |
| Deinitialize the reporters. More... | |
| int | status_vars_init () |
| Initialize the status variable manager and initialize (but do not register) all status variables. More... | |
| int | status_vars_deinit () |
| Deinitialize the status variable manager after all status variables have been deregistered. More... | |
| int | status_vars_register () |
| Register all status variables. More... | |
| int | status_vars_unregister () |
| Deregister all status variables. More... | |
| int | supervisor_init () |
| Initialize the task supervisor. More... | |
| int | supervisor_deinit () |
| Deinitialize the task supervisor. More... | |
| int | system_vars_init () |
| Initialize but do not register all system variables. More... | |
| int | system_vars_register () |
| Register all system variables. More... | |
| int | system_vars_unregister () |
| Deregister all system variables. More... | |
| int | tables_init () |
| Initialize the table manager. More... | |
| int | tables_deinit () |
| Deinitialize the table manager after all tables have been deregistered. More... | |
| int | tables_register () |
| Register all Health Monitor tables in the Performance Schema. More... | |
| int | tables_unregister () |
| Deregister all Health Monitor tables. More... | |
| int | metrics_register () |
| Register metric sources exposed by the component. More... | |
| int | metrics_unregister () |
| Deregister metric sources exposed by the component. More... | |
| void | server_utils_init () |
| Initialize the server utility functions. More... | |
| void | server_utils_deinit () |
| Deinitialize the server utility functions. More... | |
| int | option_usage_tracker_init () |
| Register option usage tracker. More... | |
| int | option_usage_tracker_deinit () |
| Deregister option usage tracker. More... | |
Private Attributes | |
| std::unique_ptr< Disk_Collector > | m_disk_collector |
| std::unique_ptr< Disk_Forecaster > | m_disk_forecaster |
| std::unique_ptr< Memory_Collector > | m_memory_collector |
| std::unique_ptr< System_Collector > | m_system_collector |
| std::unique_ptr< Log > | m_log |
| std::unique_ptr< Periodic_Reporter > | m_periodic_reporter |
| std::unique_ptr< Status_vars > | m_status_vars |
| std::unique_ptr< Supervisor > | m_supervisor |
| std::unique_ptr< Tables > | m_tables |
| std::unique_ptr< Triggered_Reporter > | m_memory_reporter |
| const std::string | m_name {"Health Monitor"} |
| const std::string | m_sysvar_prefix {"health_monitor"} |
| bool | m_status_vars_registered {false} |
| bool | m_system_vars_registered {false} |
| bool | m_collectors_initialized {false} |
| bool | m_collectors_started {false} |
| bool | m_tables_initialized {false} |
| bool | m_tables_registered {false} |
| bool | m_metrics_registered {false} |
Static Private Attributes | |
| static Health_Monitor * | m_instance {nullptr} |
| static std::atomic< bool > | m_hm_initialized {false} |
| static std::atomic< bool > | m_server_shutting_down {false} |
Own the objects used by one Health Monitor component instance.
Component initialization and deinitialization control their lifetime. Accessors return borrowed pointers, which can be null during initialization and teardown. Callers must not retain them beyond the component lifetime. Accessors do not synchronize access with component deinitialization.
|
privatedefault |
|
privatedefault |
|
privatedelete |
|
privatedelete |
|
staticnoexcept |
The Health Monitor is available if it is initialized and the server is not shutting down.
|
private |
Deinitialize the Health Monitor collectors.
|
private |
Initialize the Health Monitor collectors.
|
private |
Start the Health Monitor collectors.
|
private |
Shut down the collectors.
|
static |
Stop workers and unregister callbacks before destroying the component owner.
|
static |
Create the component owner before publishing any of its objects to callbacks.
On failure, release partially initialized objects while services are available.
|
private |
Health monitor deinitialization.
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
private |
Health monitor initialization:
|
inline |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
private |
Deinitialize the log manager.
|
private |
Initialize the log manager.
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
private |
Register metric sources exposed by the component.
|
private |
Deregister metric sources exposed by the component.
|
inline |
|
privatedelete |
|
privatedelete |
|
private |
Deregister option usage tracker.
|
private |
Register option usage tracker.
|
inlinestaticnoexcept |
|
private |
Deinitialize the reporters.
|
private |
Initialize the report manager.
|
private |
Deinitialize the server utility functions.
|
private |
Initialize the server utility functions.
| void hm::Health_Monitor::set_server_shutting_down | ( | bool | shutdown | ) |
Notify all Collectors that the server is shutting down and to stop work immediately.
Although the Collector threads will eventually be terminated by component_deinit(), this ensures that Health Monitor will not issue queries or make system variable updates during shutdown.
| [in] | shutdown | New value of the shutdown flag |
|
inlinestaticnoexcept |
|
private |
Deinitialize the status variable manager after all status variables have been deregistered.
|
private |
Initialize the status variable manager and initialize (but do not register) all status variables.
|
private |
Register all status variables.
|
private |
Deregister all status variables.
|
inlinestaticnoexcept |
|
private |
Deinitialize the task supervisor.
|
private |
Initialize the task supervisor.
|
inlinestaticnoexcept |
|
private |
Initialize but do not register all system variables.
|
private |
Register all system variables.
|
private |
Deregister all system variables.
|
static |
Notify collectors of pending system variable updates.
This thread currently holds the LOCK_global_system_variables. The update process will signal the thread to stop, apply the new settings, and then restart it.
To avoid deadlocks, the update will be deferred for threads executing SQL queries or accessing global system variables until they complete their processing and release the LOCK_global_system_variables lock.
|
inline |
|
inlinestaticnoexcept |
|
private |
Deinitialize the table manager after all tables have been deregistered.
|
private |
Initialize the table manager.
|
private |
Register all Health Monitor tables in the Performance Schema.
|
private |
Deregister all Health Monitor tables.
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |