MySQL 9.1.0
Source Code Documentation
group_replication_flow_control_metrics_service.h
Go to the documentation of this file.
1/* Copyright (c) 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef GROUP_REPLICATION_FLOW_CONTROL_METRICS_SERVICE_H
25#define GROUP_REPLICATION_FLOW_CONTROL_METRICS_SERVICE_H
26
28#include <stddef.h>
29
30/**
31 @ingroup group_components_services_inventory
32
33 A service that retrieve extra flow control stats from a member.
34
35 This only works if the component is on a server with group replication
36 running.
37
38 @code
39 SERVICE_TYPE(registry) *plugin_registry = mysql_plugin_registry_acquire();
40 my_service<SERVICE_TYPE(group_replication_flow_control_metrics_service)> svc(
41 "group_replication_message_service_send", plugin_registry);
42
43 uint64_t value;
44 if (svc.is_valid()) {
45 bool error = svc->gr_flow_control_throttle_count(&value);
46 }
47 @endcode
48*/
49BEGIN_SERVICE_DEFINITION(group_replication_flow_control_metrics_service)
50
51/**
52 This function SHALL be called whenever the caller wants to
53 read number of throttled transactions on this server since Group Replication
54 start.
55
56 @param[out] counts number of transactions throttled
57
58 @return false success, true on failure. Failure can happen if not able to
59 read values from Group Replication metrics.
60*/
62
63/**
64 This function SHALL be called whenever the caller wants to
65 read sum of time of throttled transactions on this server since Group
66 Replication start.
67
68 @param[out] time_sum time in microseconds of transactions throttled
69
70 @return false success, true on failure. Failure can happen if not able to
71 read values from Group Replication metrics.
72*/
74
75/**
76 This function SHALL be called whenever the caller wants to
77 read number of active throttled transactions on this server.
78
79 @param[out] active_count number of active transactions being throttled
80
81 @return false success, true on failure. Failure can happen if not able to
82 read values from Group Replication metrics.
83*/
85
86/**
87 This function SHALL be called whenever the caller wants to
88 read timestamp last transaction was throttled on this server since Group
89 Replication start.
90
91 @param[out] timestamp string representation of date. Buffer
92 shall be bigger than
93 MAX_DATE_STRING_REP_LENGTH.
94
95 @return false success, true on failure. Failure can happen if not able to
96 read values from Group Replication metrics.
97*/
99
100END_SERVICE_DEFINITION(group_replication_flow_control_metrics_service)
101
102#endif /* GROUP_REPLICATION_FLOW_CONTROL_METRICS_SERVICE_H */
constexpr value_type timestamp
Definition: classic_protocol_constants.h:278
mysql_service_status_t get_throttle_time_sum(uint64_t *value) noexcept
Definition: get_metrics.cc:42
mysql_service_status_t get_throttle_count(uint64_t *value) noexcept
Definition: get_metrics.cc:34
mysql_service_status_t get_throttle_active_count(uint64_t *value) noexcept
Definition: get_metrics.cc:50
mysql_service_status_t get_throttle_last_throttle_timestamp(char *buffer) noexcept
Definition: get_metrics.cc:58
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112