MySQL 26.10.0
Source Code Documentation
health_monitor_status_vars.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2026, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#pragma once
25
26#include <string>
27
30
31#include "component_status.h"
32
33namespace hm {
34
35extern const std::string k_offline_mode_disk_full;
36extern const std::string k_super_read_only_disk_full;
37extern const std::string k_recovery_cycles;
38extern const std::string k_option_tracker_usage;
39extern const std::string k_disk_forecaster_test_state;
40
41class Statvar {
42 public:
43 Statvar() = default;
45 bool registered{false};
46};
47
49 public:
50 Status_vars() = default;
51
52 int initialize_all();
53 int register_all();
54 void unregister_all();
55 static int register_status_var(Statvar &statvar);
56 static int unregister_status_var(Statvar &statvar);
57
58 // True if the Health Monitor set OFFLINE_MODE=ON to fence the server.
59 // False if
60 // - the Health Monitor set OFFLINE_MODE=OFF after storage recovery, or
61 // - OFFLINE_MODE was set externally to the Health Monitor.
63
64 // True if the Health Monitor set SUPER_READ_ONLY=ON to fence the server.
65 // False if
66 // - the Health Monitor set SUPER_READ_ONLY=OFF after storage recovery, or
67 // - SUPER_READ_ONLY was set externally to the Health Monitor.
69
70 // The number of storage depletion and recovery cycles, or the number of times
71 // that available disk space recovered after the Health Monitor put the server
72 // into SUPER_READ_ONLY and OFFLINE_MODE.
73 // Max cycles given by `health_monitor.disk_recovery_max_cycles`.
75
76 // Option tracker usage
78
79 // Disk Forecaster run mode.
80 // - NORMAL: Normal processing, metric collection, disk usage forecasting
81 // - TEST: A unit test or simulation is being run
82 // - STANDBY: Thread is active but processing is paused
84
85 // Disk Forecaster test state.
86 // - IDLE: No test is running (normal operation)
87 // - RUNNING: Unit test or simulation is running
89
90 // Null terminator for the SHOW_VAR array
92 bool m_registered{false};
93};
94
95} // namespace hm
Definition: health_monitor_status_vars.h:48
int initialize_all()
Initialize the Health Monitor status variables.
Definition: health_monitor_status_vars.cc:46
Statvar disk_forecaster_test_state
Definition: health_monitor_status_vars.h:88
Status_vars()=default
static int unregister_status_var(Statvar &statvar)
Unregister one status variable.
Definition: health_monitor_status_vars.cc:155
bool m_registered
Definition: health_monitor_status_vars.h:92
Statvar super_read_only_disk_full
Definition: health_monitor_status_vars.h:68
Statvar offline_mode_disk_full
Definition: health_monitor_status_vars.h:62
Statvar disk_forecaster_run_mode
Definition: health_monitor_status_vars.h:83
static int register_status_var(Statvar &statvar)
Register one status variable.
Definition: health_monitor_status_vars.cc:140
Statvar disk_recovery_count
Definition: health_monitor_status_vars.h:74
Statvar null_entry
Definition: health_monitor_status_vars.h:91
int register_all()
Register the Health Monitor status variables with the server.
Definition: health_monitor_status_vars.cc:85
void unregister_all()
Unregister the Health Monitor status variables.
Definition: health_monitor_status_vars.cc:121
Statvar option_tracker_usage
Definition: health_monitor_status_vars.h:77
Definition: health_monitor_status_vars.h:41
bool registered
Definition: health_monitor_status_vars.h:45
Statvar()=default
SHOW_VAR var
Definition: health_monitor_status_vars.h:44
Specifies macros to define Components.
Definition: component_command.h:29
const std::string k_disk_forecaster_test_state
Definition: health_monitor_status_vars.cc:39
const std::string k_offline_mode_disk_full
Definition: health_monitor_status_vars.cc:34
const std::string k_super_read_only_disk_full
Definition: health_monitor_status_vars.cc:35
const std::string k_recovery_cycles
Definition: health_monitor_status_vars.cc:36
const std::string k_option_tracker_usage
Definition: health_monitor_status_vars.cc:37
Specifies macros to define Service Implementations.
@ SHOW_UNDEF
Definition: status_variables_bits.h:33
@ SHOW_SCOPE_UNDEF
Definition: status_variables_bits.h:71
SHOW STATUS Server status variable.
Definition: status_variables_bits.h:81