![]() |
MySQL 26.10.0
Source Code Documentation
|
Disk Collector. More...
#include <health_monitor_disk.h>
Public Types | |
| enum class | Input_failure { filesystem , datadir_lookup } |
Public Member Functions | |
| Disk_Collector () | |
| Disk Collector constructor. More... | |
| void | initialize () |
| Initialize the Disk Collector. More... | |
| void | set_buffer_size () final |
| Resize the stat buffer if necessary. More... | |
| bool | settings_changed () override |
| Indicate if the Disk Collector settings have changed. More... | |
| void | set_params () final |
| Set collection parameters from the system variables. More... | |
| bool | running () const override |
| Return health_monitor.disk_running. More... | |
| std::shared_ptr< Stat_Buffer< Disk_Info > > | buffer () |
| int | get_disk_info (const std::string &target_path, Disk_Info &disk_info, Filesystem_sample_state &sample_state, Filesystem_change &change) |
| Get available free space for a monitored filesystem. More... | |
| bool | resolve_monitored_path () |
| Resolve the automatic monitored path before filesystem collection. More... | |
| void | update_disk_info () |
| Update disk info for display only. More... | |
| void | update_per_sample_totals (const Disk_Info &disk_info) |
| Update totals that change for each sample, convert to MiB. More... | |
| void | set_storage_profile (const Disk_Info &disk_info) |
| Set the storage threshold parameters for the monitored filesystem. More... | |
| Fallback_State & | fallback () |
| Mode_Timer & | fallback_timer () |
| void | start_fallback_timer () |
| Start the fallback timer. More... | |
| void | stop_fallback_timer () |
| Stop the fallback timer. More... | |
| void | cancel_fallback_timer () |
| Cancel the fallback timer: More... | |
| bool | fallback_eligible (std::string &reason) |
| Fallback eligible: Server is eligible to be placed in fallback mode if: More... | |
| bool | fallback_eligible (bool print_reason=false) |
| Fallback eligible: Print reason if ineligible. More... | |
| bool | forced_fallback_eligible () |
| Return true if forced fallback is allowed. More... | |
| void | set_fallback_mode (bool force) |
| Set the server fallback mode, OFFLINE_MODE and SUPER_READ_ONLY. More... | |
| void | clear_fallback_mode () |
| Clear OFFLINE_MODE and SUPER_READ_ONLY, reset all fallback state variables. More... | |
| bool | check_fenced_server_state () |
| Check if the state of a fenced server changed: More... | |
| void | process_expired_fallback_timer () |
| Process expired fallback timer. More... | |
| void | reset_fallback_and_recovery () |
| Reset fallback and recovery modes, cancel all timers. More... | |
| void | cancel_fallback_process () |
| Cancel the ongoing fallback process. More... | |
| bool | set_offline_mode (int max_retries, bool &already_set) |
| Attempt to set OFFLINE_MODE. More... | |
| bool | clear_offline_mode () |
| Clear OFFLINE_MODE. More... | |
| bool | set_super_read_only (int max_retries, bool &already_set) |
| Set SUPER_READ_ONLY. More... | |
| bool | clear_super_read_only (int max_retries) |
| Clear READ_ONLY and SUPER_READ_ONLY. More... | |
| bool | terminate_and_retry (const Processlist_Ids &plist_ids, int group_size, bool query_only) |
| Terminate queries or connections until SUPER_READ_ONLY can be set. More... | |
| bool | terminate_queries (const Processlist_Ids &plist_ids, int group_size) |
| bool | terminate_connections (const Processlist_Ids &plist_ids, int group_size) |
| Recovery_State & | recovery () |
| bool | recovery_eligible (std::string &reason) |
| Recovery eligible. More... | |
| void | check_recovery_status () |
| Check the recovery status after the server has been fenced. More... | |
| bool | above_recovery_level () const |
| bool | below_recovery_level () const |
| void | complete_recovery_process () |
| Complete the recovery process: More... | |
| void | cancel_recovery_process () |
| Cancel the recovery process: More... | |
| bool | max_recovery_cycles () |
| Check if the max recovery cycle count has been reached. More... | |
| void | set_recovery_window (bool print_status) |
| Set the end of the recovery window. More... | |
| void | check_recovery_window () |
| Check the recovery window. More... | |
| Mode_Timer & | recovery_timer_1 () |
| void | set_recovery_timeout_1 () |
| Set the timeout for recovery timer 1. More... | |
| void | start_recovery_timer_1 () |
| Start the recovery_1 timer: More... | |
| void | stop_recovery_timer_1 () |
| Stop the recovery_1 timer: More... | |
| void | cancel_recovery_timer_1 () |
| Cancel the recovery_1 timer: More... | |
| Mode_Timer & | recovery_timer_2 () |
| void | set_recovery_timeout_2 () |
| Set the timeout for recovery timer 2. More... | |
| void | start_recovery_timer_2 () |
| Start the recovery_2 timer: More... | |
| void | stop_recovery_timer_2 () |
| Stop the recovery_2 timer: More... | |
| void | cancel_recovery_timer_2 () |
| Cancel the recovery_2 timer: More... | |
| bool * | super_read_only_set_ptr () |
| bool * | offline_mode_set_ptr () |
| bool | offline_mode_disk_full () const |
| bool | super_read_only_disk_full () const |
| void | update_super_read_only_disk_full () |
| Update the 'super_read_only_disk_full' status variable. More... | |
| void | update_offline_mode_disk_full () |
| Update the 'offline_mode_disk_full' status variable. More... | |
| void | update_fallback_status_vars () |
| Update fallback status variables, log changes. More... | |
| std::string | msg_setting_super_read_only_disk_full () const |
| Log messages for updates to status variables 'super_read_only_disk_full' and 'offline_mode_disk_full'. More... | |
| std::string | msg_setting_offline_mode_disk_full () const |
| int * | recovery_count_ptr () |
| int | recovery_count () const |
| void | set_state (ds::Storage_State &new_state) |
| Set the next state based on the available space. More... | |
| void | set_start_state () |
| void | set_stop_state () |
| void | set_normal_state () |
| void | set_warning_state () |
| void | set_low_limit_state () |
| void | set_critical_state () |
| void | set_error_state () |
| void | check_storage_levels () |
| Check the available space against the storage thresholds: More... | |
| void | set_disk_metric_buffer (Disk_Metric_Buffer buffer, Disk_Forecaster *forecaster) |
| Set the time series buffer. More... | |
| std::string | format_settings () override |
| Disk Collector settings formatted string. More... | |
| std::string | format_status_info () override |
| Storage info formatted string. More... | |
| std::string | tag_collector_state () override |
| Collector state tag: Start, Stop, etc. More... | |
| std::string | tag_resource_state () override |
| Resource state tag: Normal Level, Warning Level, etc. More... | |
| std::string | tag_mode () override |
| Mode string: Fallback, Timer, etc. More... | |
| std::string | tag_fallback () |
| Fallback mode string: "Fallback". More... | |
| std::string | tag_recovery () |
| Recovery mode string: "Recovery". More... | |
| std::string | storage_status () const |
| Build storage state string. More... | |
| std::string | timer_status (Mode_Timer &timer, const std::string &msg) const |
| Timer status with optional message: Started, Running, Expired, ... More... | |
| std::string | warning_status () const |
| Warning level string: Warning Level 1, Warning Level 2, ... More... | |
| void | log_info_message (const std::string &msg, bool levels) |
| Log informational message with storage state, storage levels and message. More... | |
| void | log_info_message (const std::string &msg) |
| Log informational message with storage state, no levels and message. More... | |
| void | log_warning_status (const std::string &msg, bool levels) |
| Log warning with storage state, fallback state, storage levels and message. More... | |
| void | log_warning_status (const std::string &msg) |
| Log warning with storage state and message. More... | |
| void | log_warning_level (int level) |
| Low space warning level 1/2/3. More... | |
| void | log_warning_level () |
| void | log_warning_low_limit () |
| Low space warning with timer state. More... | |
| void | log_warning_error_condition () |
| Error condition warning. More... | |
| void | log_filesystem_recovery (const std::string &target_path) |
| Log filesystem recovery after an unavailable transition. More... | |
| void | log_timer_status (Mode_Timer &timer) |
| Timer status, no levels. More... | |
| void | log_timer_status (Mode_Timer &timer, bool levels) |
| Timer status with optional storage levels. More... | |
| void | log_timer_status (Mode_Timer &timer, const std::string &msg, bool levels) |
| Timer status with optional message and storage levels. More... | |
| void | log_volume_change () |
| The monitored disk has changed. More... | |
| void | log_volume_size_change () |
| Size of the monitored disk has changed. More... | |
| void | log_resource_status () override |
| Collector or storage status with levels, depending on state. More... | |
| void | log_resource_levels () override |
| Log the current storage levels, no message. More... | |
Public Member Functions inherited from hm::Collector | |
| Collector ()=default | |
| Collector (const char *name, const char *resource_name, const char *instr_name, const char *os_name, const char *description) | |
| ~Collector () override=default | |
| Collector (const Collector &)=delete | |
| Collector & | operator= (const Collector &)=delete |
| Collector (Collector &&)=delete | |
| Collector & | operator= (Collector &&)=delete |
| const char * | resource_name () const |
| void | run_process () override |
| Sample collection loop. More... | |
| virtual bool | dynamic_settings_changed () |
| virtual bool | static_settings_changed () |
| void | mark_settings_pending () |
| Mark a settings update for evaluation by the Supervisor. More... | |
| bool | settings_pending () const |
| void | set_settings_pending (bool pending) |
| virtual bool | update_settings () |
| Update system variable settings for the Collector. More... | |
| int | base_interval () const |
| int | sample_interval () const |
| void | set_sample_interval (int sample_interval) |
| Set the sample interval, adjust to the nearest multiple of the base interval. More... | |
| void | set_collector_intervals (int base_interval, int sample_interval) |
| Set the base and sample intervals together to ensure that the sample interval is a multiple of the base interval. More... | |
| virtual void | log_collector_status (bool settings) |
| Collector status with optional settings. More... | |
| virtual void | log_collector_status (const std::string &state_msg, bool settings) |
| Collector status with optional message and optional settings. More... | |
| virtual void | log_status () |
| Issue a log status message for the collector. More... | |
| virtual std::string | build_collector_message (const std::string &status, const std::string &mode, const std::string &message, bool settings) |
| Formatted collector message with optional settings. More... | |
| virtual std::string | build_resource_message (const std::string &status, const std::string &mode, const std::string &message, bool levels) |
| Formatted resource message, no levels or settings. More... | |
Public Member Functions inherited from hm::Thread | |
| Thread ()=default | |
| Thread (const char *name, const char *instr_name, const char *os_name, const char *desc) | |
| virtual | ~Thread ()=0 |
| const char * | name () const |
| virtual int | start () |
| virtual void | stop () |
| void | signal () |
| Signal the processing loop to end the current cycle. More... | |
Static Public Member Functions | |
| static void | set_state_params () |
| Set threshold params for all storage states. More... | |
Static Public Member Functions inherited from hm::Collector | |
| static std::string | format_level (uint64_t mbytes) |
| Format storage amount in MiB, no units. More... | |
| static std::string | format_mb (uint64_t mbytes, int prec, bool show_units) |
| Format storage amount. More... | |
Static Public Member Functions inherited from hm::Thread | |
| static void | cleanup () |
| Cleanup thread instrumentation. More... | |
| static int | join (my_thread_handle *thread, void **value_ptr) |
| static bool | joinable (const my_thread_handle &thread) |
Static Public Attributes | |
| static constexpr int | k_disk_base_interval {10} |
| static constexpr int | k_fallback_report_interval {k_disk_base_interval} |
| static constexpr int | k_recovery_report_interval {k_disk_base_interval} |
| static constexpr int | k_fallback_retries {5} |
| static constexpr int | k_delta_pct {10} |
Static Public Attributes inherited from hm::Collector | |
| static constexpr uint64_t | no_warn_level {std::numeric_limits<uint64_t>::max()} |
| static constexpr int | k_min_interval {1} |
| static constexpr int | k_max_interval {86400} |
| static constexpr int | k_default_base_interval {10} |
| static constexpr int | k_default_sample_interval {k_default_base_interval * 6} |
Protected Member Functions | |
| void | pre_process () override |
| Put the collector into the START state. More... | |
| void | process () override |
| Query and evaluate filesystem usage at the base interval. More... | |
| void | post_process () override |
| Put the collector into the STOP state, which will cancel active timers, issue status messages, etc. More... | |
Protected Member Functions inherited from hm::Collector | |
| void | consume_settings_pending () |
| Consume one pending notification without clearing a concurrent update. More... | |
| void | apply_pending_settings () |
| Apply settings while the collector command lock is held. More... | |
| Cycle_Timer & | sample_timer () |
| Cycle_Timer & | status_message_timer () |
| void | initialize_sample_timers () |
| Initialize collection timers. More... | |
| void | advance_sample_timers () |
| Process collector sample and status timers. More... | |
Protected Member Functions inherited from hm::Thread | |
| int | start_thread () |
| void | stop_thread () |
| void | request_thread_stop () |
| Request that the worker stop without waiting for it to exit. More... | |
| void | join_thread () |
| Wait for a stopped worker to exit. More... | |
| bool | stop_requested () |
| Return true when worker shutdown has been requested. More... | |
Private Member Functions | |
| void | initialize_timers () |
| Initialize the fallback and recovery timers. More... | |
| void | advance_timers () |
| Advance the timers driven by the collection interval. More... | |
Private Attributes | |
| std::shared_ptr< Stat_Buffer< Disk_Info > > | m_buffer |
| Disk_Metric_Buffer | m_disk_metric_buffer |
| Disk_Forecaster * | m_disk_forecaster {nullptr} |
| PSI_rwlock_key | m_rwlock_key {0} |
| PSI_rwlock_info | m_rwlock_info |
| PSI_memory_key | m_memory_key {0} |
| PSI_memory_info | m_memory_info |
| Server | m_server |
Additional Inherited Members | |
Protected Attributes inherited from hm::Collector | |
| const std::string | m_resource_name |
| bool | m_running {false} |
Protected Attributes inherited from hm::Thread | |
| std::mutex | m_command_lock |
| const std::string | m_name |
| const std::string | m_instr_name |
| const std::string | m_os_name |
| const std::string | m_description |
| std::atomic< bool > | m_thread_running {false} |
| bool | m_stop {false} |
| my_thread_handle | m_thread |
| PSI_thread_key | m_thread_key {0} |
| PSI_thread_info | m_thread_info |
| mysql_mutex_t | m_wait_lock |
| PSI_mutex_key | m_mutex_key {0} |
| PSI_mutex_info | m_mutex_info |
| mysql_cond_t | m_wait |
| PSI_cond_key | m_cond_key {0} |
| PSI_cond_info | m_cond_info |
Disk Collector.
The Disk Collector monitors space on the filesystem path specified by health_monitor.disk_monitored. It collects filesystem usage, detects filesystem and capacity changes, publishes samples and supplies disk metrics to the Disk Forecaster.
The collector classifies available space as normal, warning, low or critical. When fencing is enabled, low and critical states can cause the collector to set OFFLINE_MODE and SUPER_READ_ONLY. The collector records which modes it set so that when disk space recovers, the Health Monitor clears only changes that it made.
If the monitored path or filesystem is unavailable, then the Disk Collector suspends sample collection and retries on subsequent collection cycles.
|
strong |
| hm::Disk_Collector::Disk_Collector | ( | ) |
Disk Collector constructor.
Initialize the stat buffer and instrumentation.
|
inline |
|
private |
Advance the timers driven by the collection interval.
|
inline |
|
inline |
| void hm::Disk_Collector::cancel_fallback_process | ( | ) |
Cancel the ongoing fallback process.
Leave fallback state unchanged.
| void hm::Disk_Collector::cancel_fallback_timer | ( | ) |
Cancel the fallback timer:
| void hm::Disk_Collector::cancel_recovery_process | ( | ) |
Cancel the recovery process:
| void hm::Disk_Collector::cancel_recovery_timer_1 | ( | ) |
Cancel the recovery_1 timer:
| void hm::Disk_Collector::cancel_recovery_timer_2 | ( | ) |
Cancel the recovery_2 timer:
| bool hm::Disk_Collector::check_fenced_server_state | ( | ) |
Check if the state of a fenced server changed:
If the server state changed, then sync the fallback state accordingly.
This is independent of the recovery process, changes in storage levels or updates to the Health Monitor settings.
| void hm::Disk_Collector::check_recovery_status | ( | ) |
Check the recovery status after the server has been fenced.
This is only called if the server was fenced by the Health Monitor.
Recovery from fallback mode is done in two phases. If storage rises above the recovery level, then:
Increase the recovery delays by 'disk_recovery_increment' for each recovery cycle.
| void hm::Disk_Collector::check_recovery_window | ( | ) |
Check the recovery window.
If sufficient time has elapsed since the last recovery, then reset the recovery cycle count.
| void hm::Disk_Collector::check_storage_levels | ( | ) |
Check the available space against the storage thresholds:
| void hm::Disk_Collector::clear_fallback_mode | ( | ) |
Clear OFFLINE_MODE and SUPER_READ_ONLY, reset all fallback state variables.
This is called when the Health Monitor settings change or a new or resized volume is detected.
| bool hm::Disk_Collector::clear_offline_mode | ( | ) |
Clear OFFLINE_MODE.
| bool hm::Disk_Collector::clear_super_read_only | ( | int | max_retries | ) |
Clear READ_ONLY and SUPER_READ_ONLY.
Retry if necessary.
| max_retries | Number of attempts to make |
| void hm::Disk_Collector::complete_recovery_process | ( | ) |
Complete the recovery process:
|
inline |
| bool hm::Disk_Collector::fallback_eligible | ( | bool | print_reason = false | ) |
Fallback eligible: Print reason if ineligible.
| print_reason | Print the reason why the server cannot be fenced |
| bool hm::Disk_Collector::fallback_eligible | ( | std::string & | reason | ) |
Fallback eligible: Server is eligible to be placed in fallback mode if:
| reason | Reason for ineligibility |
|
inline |
| bool hm::Disk_Collector::forced_fallback_eligible | ( | ) |
Return true if forced fallback is allowed.
Criteria:
|
overridevirtual |
Disk Collector settings formatted string.
Reimplemented from hm::Collector.
|
overridevirtual |
Storage info formatted string.
Reimplemented from hm::Collector.
| int hm::Disk_Collector::get_disk_info | ( | const std::string & | target_path, |
| Disk_Info & | disk_info, | ||
| Filesystem_sample_state & | sample_state, | ||
| Filesystem_change & | change | ||
| ) |
Get available free space for a monitored filesystem.
| [in] | target_path | A valid path |
| [out] | disk_info | Storage info for the filesystem |
| [in,out] | sample_state | Last successful filesystem sample state |
| [out] | change | Current sample classification |
| void hm::Disk_Collector::initialize | ( | ) |
Initialize the Disk Collector.
Performs initialization after construction. Call this immediately after creating the collector.
|
private |
Initialize the fallback and recovery timers.
| void hm::Disk_Collector::log_filesystem_recovery | ( | const std::string & | target_path | ) |
Log filesystem recovery after an unavailable transition.
| void hm::Disk_Collector::log_info_message | ( | const std::string & | msg | ) |
Log informational message with storage state, no levels and message.
| void hm::Disk_Collector::log_info_message | ( | const std::string & | msg, |
| bool | levels | ||
| ) |
Log informational message with storage state, storage levels and message.
|
overridevirtual |
Log the current storage levels, no message.
Reimplemented from hm::Collector.
|
overridevirtual |
Collector or storage status with levels, depending on state.
Implements hm::Collector.
| void hm::Disk_Collector::log_timer_status | ( | Mode_Timer & | timer | ) |
Timer status, no levels.
| void hm::Disk_Collector::log_timer_status | ( | Mode_Timer & | timer, |
| bool | levels | ||
| ) |
Timer status with optional storage levels.
| void hm::Disk_Collector::log_timer_status | ( | Mode_Timer & | timer, |
| const std::string & | msg, | ||
| bool | levels | ||
| ) |
Timer status with optional message and storage levels.
| void hm::Disk_Collector::log_volume_change | ( | ) |
The monitored disk has changed.
| void hm::Disk_Collector::log_volume_size_change | ( | ) |
Size of the monitored disk has changed.
| void hm::Disk_Collector::log_warning_error_condition | ( | ) |
Error condition warning.
|
inline |
| void hm::Disk_Collector::log_warning_level | ( | int | level | ) |
Low space warning level 1/2/3.
| void hm::Disk_Collector::log_warning_low_limit | ( | ) |
Low space warning with timer state.
Only use the "Fallback" tag if the server is fenced or in the process of being fenced.
| void hm::Disk_Collector::log_warning_status | ( | const std::string & | msg | ) |
Log warning with storage state and message.
| void hm::Disk_Collector::log_warning_status | ( | const std::string & | msg, |
| bool | levels | ||
| ) |
Log warning with storage state, fallback state, storage levels and message.
| bool hm::Disk_Collector::max_recovery_cycles | ( | ) |
Check if the max recovery cycle count has been reached.
| std::string hm::Disk_Collector::msg_setting_offline_mode_disk_full | ( | ) | const |
| std::string hm::Disk_Collector::msg_setting_super_read_only_disk_full | ( | ) | const |
Log messages for updates to status variables 'super_read_only_disk_full' and 'offline_mode_disk_full'.
|
inline |
|
inline |
|
overrideprotectedvirtual |
Put the collector into the STOP state, which will cancel active timers, issue status messages, etc.
Reimplemented from hm::Thread.
|
overrideprotectedvirtual |
Put the collector into the START state.
Reimplemented from hm::Thread.
|
overrideprotectedvirtual |
Query and evaluate filesystem usage at the base interval.
Publish a Performance Schema record only when the sample interval expires and publish a disk metric record when its metric buffer is writable. Check the available space against the storage limits and take appropriate action if necessary.
Reimplemented from hm::Collector.
| void hm::Disk_Collector::process_expired_fallback_timer | ( | ) |
Process expired fallback timer.
|
inline |
|
inline |
|
inline |
| bool hm::Disk_Collector::recovery_eligible | ( | std::string & | reason | ) |
Recovery eligible.
Server is eligible to recover from fallback mode if:
| reason | Message string giving reason for ineligibility |
|
inline |
|
inline |
| void hm::Disk_Collector::reset_fallback_and_recovery | ( | ) |
Reset fallback and recovery modes, cancel all timers.
Invoked after the monitored filesystem capacity changes.
| bool hm::Disk_Collector::resolve_monitored_path | ( | ) |
Resolve the automatic monitored path before filesystem collection.
|
overridevirtual |
Return health_monitor.disk_running.
Reimplemented from hm::Thread.
|
finalvirtual |
Resize the stat buffer if necessary.
Must be inside collector lock.
Reimplemented from hm::Collector.
|
inline |
| void hm::Disk_Collector::set_disk_metric_buffer | ( | Disk_Metric_Buffer | buffer, |
| Disk_Forecaster * | forecaster | ||
| ) |
Set the time series buffer.
| buffer | Disk time series buffer |
| forecaster | Disk Forecaster associated with the buffer |
|
inline |
| void hm::Disk_Collector::set_fallback_mode | ( | bool | force | ) |
Set the server fallback mode, OFFLINE_MODE and SUPER_READ_ONLY.
| force | If true then terminate queries blocking SUPER_READ_ONLY |
|
inline |
|
inline |
| bool hm::Disk_Collector::set_offline_mode | ( | int | max_retries, |
| bool & | already_set | ||
| ) |
Attempt to set OFFLINE_MODE.
Retry if necessary.
| max_retries | Number of attempts to make |
| already_set | True if OFFLINE_MODE was already set |
|
finalvirtual |
Set collection parameters from the system variables.
Reimplemented from hm::Collector.
| void hm::Disk_Collector::set_recovery_timeout_1 | ( | ) |
Set the timeout for recovery timer 1.
| void hm::Disk_Collector::set_recovery_timeout_2 | ( | ) |
Set the timeout for recovery timer 2.
| void hm::Disk_Collector::set_recovery_window | ( | bool | print_status | ) |
Set the end of the recovery window.
param[in] print_status If true, issue log message
|
inline |
| void hm::Disk_Collector::set_state | ( | ds::Storage_State & | new_state | ) |
Set the next state based on the available space.
|
static |
Set threshold params for all storage states.
|
inline |
| void hm::Disk_Collector::set_storage_profile | ( | const Disk_Info & | disk_info | ) |
Set the storage threshold parameters for the monitored filesystem.
This requires that a disk sample has been collected.
| [in] | disk_info | Current block device info |
| bool hm::Disk_Collector::set_super_read_only | ( | int | max_retries, |
| bool & | already_set | ||
| ) |
Set SUPER_READ_ONLY.
Retry if necessary. Setting SUPER_READ_ONLY also sets READ_ONLY.
| max_retries | Number of attempts to make |
| already_set | True if SUPER_READ_ONLY already set |
|
inline |
|
overridevirtual |
Indicate if the Disk Collector settings have changed.
Reimplemented from hm::Collector.
| void hm::Disk_Collector::start_fallback_timer | ( | ) |
Start the fallback timer.
| void hm::Disk_Collector::start_recovery_timer_1 | ( | ) |
Start the recovery_1 timer:
| void hm::Disk_Collector::start_recovery_timer_2 | ( | ) |
Start the recovery_2 timer:
| void hm::Disk_Collector::stop_fallback_timer | ( | ) |
Stop the fallback timer.
| void hm::Disk_Collector::stop_recovery_timer_1 | ( | ) |
Stop the recovery_1 timer:
| void hm::Disk_Collector::stop_recovery_timer_2 | ( | ) |
Stop the recovery_2 timer:
| std::string hm::Disk_Collector::storage_status | ( | ) | const |
Build storage state string.
|
inline |
|
inline |
|
overridevirtual |
Collector state tag: Start, Stop, etc.
Reimplemented from hm::Collector.
| std::string hm::Disk_Collector::tag_fallback | ( | ) |
Fallback mode string: "Fallback".
|
overridevirtual |
Mode string: Fallback, Timer, etc.
Reimplemented from hm::Collector.
| std::string hm::Disk_Collector::tag_recovery | ( | ) |
Recovery mode string: "Recovery".
|
overridevirtual |
Resource state tag: Normal Level, Warning Level, etc.
Reimplemented from hm::Collector.
| bool hm::Disk_Collector::terminate_and_retry | ( | const Processlist_Ids & | plist_ids, |
| int | group_size, | ||
| bool | query_only | ||
| ) |
Terminate queries or connections until SUPER_READ_ONLY can be set.
| plist_ids | Processlist ids of connections to terminate |
| group_size | Terminate connections/queries in groups of this size |
| query_only | Terminate the queries, not the connections |
|
inline |
|
inline |
| std::string hm::Disk_Collector::timer_status | ( | Mode_Timer & | timer, |
| const std::string & | msg | ||
| ) | const |
Timer status with optional message: Started, Running, Expired, ...
| void hm::Disk_Collector::update_disk_info | ( | ) |
Update disk info for display only.
Do not write to the stat buffer, do not check storage levels, do not change collector state.
| void hm::Disk_Collector::update_fallback_status_vars | ( | ) |
Update fallback status variables, log changes.
| void hm::Disk_Collector::update_offline_mode_disk_full | ( | ) |
Update the 'offline_mode_disk_full' status variable.
| void hm::Disk_Collector::update_per_sample_totals | ( | const Disk_Info & | disk_info | ) |
Update totals that change for each sample, convert to MiB.
| void hm::Disk_Collector::update_super_read_only_disk_full | ( | ) |
Update the 'super_read_only_disk_full' status variable.
| std::string hm::Disk_Collector::warning_status | ( | ) | const |
Warning level string: Warning Level 1, Warning Level 2, ...
| const std::string hm::Disk_Collector::k_canceled {"Canceled"} |
| const std::string hm::Disk_Collector::k_critical_level {"Critical Level"} |
|
staticconstexpr |
|
staticconstexpr |
| const std::string hm::Disk_Collector::k_expired {"Expired"} |
| const std::string hm::Disk_Collector::k_fallback {"Fallback"} |
| const std::string hm::Disk_Collector::k_fallback_error {"Fallback Error"} |
| const std::string hm::Disk_Collector::k_fallback_mode {k_super_read_only} |
|
staticconstexpr |
|
staticconstexpr |
| const std::string hm::Disk_Collector::k_fallback_timer {"Fallback Timer"} |
| const std::string hm::Disk_Collector::k_low_level {"Low Level"} |
| const std::string hm::Disk_Collector::k_normal_level {"Normal Level"} |
| const std::string hm::Disk_Collector::k_recovery {"Recovery"} |
| const std::string hm::Disk_Collector::k_recovery_1_mode {k_offline_mode} |
| const std::string hm::Disk_Collector::k_recovery_2_mode {k_super_read_only} |
| const std::string hm::Disk_Collector::k_recovery_error {"Recovery Error"} |
|
staticconstexpr |
| const std::string hm::Disk_Collector::k_recovery_timer_1 {"Timer 1"} |
| const std::string hm::Disk_Collector::k_recovery_timer_2 {"Timer 2"} |
| const std::string hm::Disk_Collector::k_running {"Running"} |
| const std::string hm::Disk_Collector::k_sample_timer {"Disk Sample Timer"} |
| const std::string hm::Disk_Collector::k_warning_level {"Warning Level"} |
| uint64_t hm::Disk_Collector::m_avail_mb {0} |
|
private |
| std::string hm::Disk_Collector::m_configured_monitored |
| uint64_t hm::Disk_Collector::m_critical_level_mb {0} |
| ds::Critical_State hm::Disk_Collector::m_critical_state |
| ds::Storage_State* hm::Disk_Collector::m_current_state {nullptr} |
| int hm::Disk_Collector::m_delta_pct {k_delta_pct} |
| bool hm::Disk_Collector::m_disk_error {false} |
|
private |
|
private |
| ds::Error_State hm::Disk_Collector::m_error_state |
| Fallback_State hm::Disk_Collector::m_fallback |
| Mode_Timer hm::Disk_Collector::m_fallback_timer |
| Filesystem_change hm::Disk_Collector::m_filesystem_change {Filesystem_change::initial} |
| Filesystem_sample_state hm::Disk_Collector::m_filesystem_sample_state |
| Disk_Info hm::Disk_Collector::m_info |
| Input_failure hm::Disk_Collector::m_input_failure {Input_failure::filesystem} |
| uint64_t hm::Disk_Collector::m_last_avail_mb {0} |
| uint64_t hm::Disk_Collector::m_last_warn_level_mb {no_warn_level} |
| ds::Low_Limit_State hm::Disk_Collector::m_low_limit_state |
| uint64_t hm::Disk_Collector::m_low_space_critical_level {0} |
| int hm::Disk_Collector::m_low_space_duration {0} |
| uint64_t hm::Disk_Collector::m_low_space_level {0} |
| int hm::Disk_Collector::m_low_space_pct {0} |
| uint64_t hm::Disk_Collector::m_max_warn_level_mb {no_warn_level} |
|
private |
|
private |
| std::string hm::Disk_Collector::m_monitored |
| uint64_t hm::Disk_Collector::m_monitored_generation {0} |
| bool hm::Disk_Collector::m_new_size {false} |
| bool hm::Disk_Collector::m_new_volume {false} |
| ds::Normal_State hm::Disk_Collector::m_normal_state |
| uint64_t hm::Disk_Collector::m_operative_space_mb {0} |
| Recovery_State hm::Disk_Collector::m_recovery |
| Mode_Timer hm::Disk_Collector::m_recovery_timer_1 |
| Mode_Timer hm::Disk_Collector::m_recovery_timer_2 |
| bool hm::Disk_Collector::m_refresh_storage_profile {false} |
| uint64_t hm::Disk_Collector::m_reserve_mb {0} |
|
private |
|
private |
|
private |
| std::atomic<bool> hm::Disk_Collector::m_settings_changed {false} |
| ds::Start_State hm::Disk_Collector::m_start_state |
| bool hm::Disk_Collector::m_status_offline_mode_disk_full {false} |
| bool hm::Disk_Collector::m_status_super_read_only_disk_full {false} |
| ds::Stop_State hm::Disk_Collector::m_stop_state |
| uint64_t hm::Disk_Collector::m_total_space_mb {0} |
| std::optional<std::string> hm::Disk_Collector::m_unavailable_path |
| float hm::Disk_Collector::m_used_pct {0} |
| uint64_t hm::Disk_Collector::m_warn_level_1_mb {0} |
| int hm::Disk_Collector::m_warn_level_1_pct {0} |
| uint64_t hm::Disk_Collector::m_warn_level_2_mb {0} |
| int hm::Disk_Collector::m_warn_level_2_pct {0} |
| uint64_t hm::Disk_Collector::m_warn_level_3_mb {0} |
| int hm::Disk_Collector::m_warn_level_3_pct {0} |
| ds::Warning_State hm::Disk_Collector::m_warning_state |