You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineMONITOR_SQLITE_TABLE_PGSQL_SERVER_CONNECT_LOG"CREATE TABLE pgsql_server_connect_log (hostname VARCHAR NOT NULL , port INT NOT NULL DEFAULT 3306 , time_start_us INT NOT NULL DEFAULT 0 , connect_success_time_us INT DEFAULT 0 , connect_error VARCHAR , PRIMARY KEY (hostname, port, time_start_us))"
14
+
15
+
#defineMONITOR_SQLITE_TABLE_PGSQL_SERVER_PING_LOG"CREATE TABLE pgsql_server_ping_log ( hostname VARCHAR NOT NULL , port INT NOT NULL DEFAULT 3306 , time_start_us INT NOT NULL DEFAULT 0 , ping_success_time_us INT DEFAULT 0 , ping_error VARCHAR , PRIMARY KEY (hostname, port, time_start_us))"
16
+
17
+
#defineMONITOR_SQLITE_TABLE_PGSQL_SERVERS"CREATE TABLE pgsql_servers (hostname VARCHAR NOT NULL , port INT NOT NULL DEFAULT 3306 , status INT CHECK (status IN (0, 1, 2, 3, 4)) NOT NULL DEFAULT 0 , use_ssl INT CHECK (use_ssl IN(0,1)) NOT NULL DEFAULT 0 , PRIMARY KEY (hostname, port) )"
18
+
19
+
#defineMONITOR_SQLITE_TABLE_PROXYSQL_SERVERS"CREATE TABLE proxysql_servers (hostname VARCHAR NOT NULL , port INT NOT NULL DEFAULT 6032 , weight INT CHECK (weight >= 0) NOT NULL DEFAULT 0 , comment VARCHAR NOT NULL DEFAULT '' , PRIMARY KEY (hostname, port) )"
20
+
21
+
structPgSQL_Monitor {
22
+
// @brief Flags if monitoring threads should be shutdown.
23
+
bool shutdown = false;
24
+
// @brief Mutex to hold to update `monitor_internal.pgsql_servers`
25
+
std::mutex pgsql_srvs_mutex {};
26
+
// @brief Mutex to hold to update/read `pgsql_servers` to monitor
27
+
std::mutex pgsql_srvs_to_monitor_mutex {};
28
+
// @brief Used to access monitor database
29
+
SQLite3DB monitordb {};
30
+
// @brief Used to access internal monitor database
0 commit comments