MySQL 9.7.0
Source Code Documentation
resource_manager_channel_lag.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2024, 2026, Oracle and/or its affiliates.
3*/
4
5#ifndef GR_RESOURCE_MANAGER_CHANNEL_LAG
6#define GR_RESOURCE_MANAGER_CHANNEL_LAG
7
8#include <my_inttypes.h>
9#include <string>
10#include <vector>
11
12namespace gr_resource_manager {
13/**
14 Stores the channel lag information.
15*/
16struct lag_record {
17 /// Stores the timestamp when information was fetched.
18 long long timestamp{0};
19 /// Either group_replication_applier_channel_lag or
20 /// group_replication_recovery_channel_lag.
21 std::string metric{""};
22 /// Either group_replication_applier or group_replication_recovery.
23 std::string channel_name{""};
24 /// Lag in seconds.
26};
27
28/**
29 @class GR_resource_manager
30
31 This class will be used to execute SQL Queries.
32 For each SQL Query run a new function needs to be implemented.
33 */
35 public:
36 /**
37 Execute a SQL Query and fetch the lag for group replication applier channel
38 and recovery channel.
39
40 @param[out] record Group replication channels lag
41
42 @retval 0 Query execution success
43 @retval 1 Query execution failed
44 */
45 static int fetch_channel_lag(std::vector<lag_record> &record);
46
47#if !defined(NDEBUG)
48 /**
49 Check if the passed string is present in GLOBAL.DEBUG or not.
50
51 @param[in] variable debug string to check in GLOBAL.DEBUG
52
53 @retval true string is present in GLOBAL.DEBUG
54 @retval false string is not present in GLOBAL.DEBUG
55 */
56 static bool is_debug_variable_present(const std::string &variable);
57#endif
58};
59} // namespace gr_resource_manager
60
61#endif // GR_RESOURCE_MANAGER_CHANNEL_LAG
This class will be used to execute SQL Queries.
Definition: resource_manager_channel_lag.h:34
static int fetch_channel_lag(std::vector< lag_record > &record)
Execute a SQL Query and fetch the lag for group replication applier channel and recovery channel.
Definition: resource_manager_channel_lag.cc:145
static bool is_debug_variable_present(const std::string &variable)
Check if the passed string is present in GLOBAL.DEBUG or not.
Definition: resource_manager_channel_lag.cc:92
Some integer typedefs for easier portability.
static int record
Definition: mysqltest.cc:195
Definition: resource_manager.cc:53
Stores the channel lag information.
Definition: resource_manager_channel_lag.h:16
uint lag_in_seconds
Lag in seconds.
Definition: resource_manager_channel_lag.h:25
std::string channel_name
Either group_replication_applier or group_replication_recovery.
Definition: resource_manager_channel_lag.h:23
std::string metric
Either group_replication_applier_channel_lag or group_replication_recovery_channel_lag.
Definition: resource_manager_channel_lag.h:21
long long timestamp
Stores the timestamp when information was fetched.
Definition: resource_manager_channel_lag.h:18