MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
applier_metrics_stub.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 CHANGESTREAMS_APPLY_METRICS_APPLIER_METRICS_STUB_H
25#define CHANGESTREAMS_APPLY_METRICS_APPLIER_METRICS_STUB_H
26
29
30namespace cs::apply::instruments {
31
32/// @brief Class that intends to be a dummy end point for applier metrics
34 public:
35 /// @brief Remember "now" as the last applier start time.
36 void store_last_applier_start() override;
37
38 /// @brief Return time metric for total applier execution time.
39 /// @return a Time_based_metric_interface object that contains metric
40 /// information on a wait
42
43 /// @brief Gets the time point when the metric timer started.
44 /// @return The time point since the collection of statistics started.
45 int64_t get_last_applier_start_micros() const override;
46
47 /// @brief Returns the total time the applier was running
48 /// @return Amount of time the applier threads were running for this channel
49 int64_t get_total_execution_time() const override;
50
51 /// @brief increment the number of transactions committed.
52 /// @param amount the amount of transactions to increment.
53 void inc_transactions_committed_count(int64_t amount) override;
54
55 /// @brief Gets the number of transactions committed.
56 /// @return the number of transactions committed.
57 int64_t get_transactions_committed_count() const override;
58
59 /// @brief increment the number of transactions pending.
60 /// @param amount the amount of transactions to increment.
61 void inc_transactions_received_count(int64_t amount) override;
62
63 /// @brief Gets the number of transactions pending.
64 /// @return the number of transactions waiting execution.
65 int64_t get_transactions_received_count() const override;
66
67 /// @brief increment the size of transactions committed.
68 /// @param amount the size amount to increment.
69 void inc_transactions_committed_size_sum(int64_t amount) override;
70
71 /// @brief Gets the total sum of the size of committed transactions
72 /// @return the total size of committed transactions
73 int64_t get_transactions_committed_size_sum() const override;
74
75 /// @brief increment the pending size of queued transactions.
76 /// @param amount the size amount to increment.
77 void inc_transactions_received_size_sum(int64_t amount) override;
78
79 /// @brief Gets the pending size sum of queued transactions
80 /// @return the exectuted size of pending transactions
81 int64_t get_transactions_received_size_sum() const override;
82
83 /// @brief increment the number of events scheduled by a given amount.
84 /// @param v the amount of events to increment.
85 void inc_events_committed_count(int64_t v) override;
86
87 /// @brief Gets the number of events scheduled.
88 /// @return the number of events scheduled.
89 int64_t get_events_committed_count() const override;
90
91 /// @brief Resets the statistics to zero.
92 void reset() override;
93
94 /// @return false.
95 bool is_after_metrics_breakpoint() const override;
96
97 /// Do nothing.
98 void set_metrics_breakpoint(const char *relay_log_filename) override;
99
100 /// Do nothing
101 void check_metrics_breakpoint(const char *relay_log_filename) override;
102
103 /// @brief Returns time metrics for waits on work from the source
104 /// @return a Time_based_metric_interface object that contains metric
105 /// information on a wait
107
108 /// @brief Returns time metrics for waits on available workers
109 /// @return a Time_based_metric_interface object that contains metric
110 /// information on a wait
112
113 /// @brief Returns time metrics for waits on transaction dependecies on
114 /// workers
115 /// @return a Time_based_metric_interface object that contains metric
116 /// information on a wait
118 override;
119
120 /// @brief Returns time metrics for waits when a worker queue exceeds max
121 /// memory
122 /// @return a Time_based_metric_interface object that contains metric
123 /// information on a wait
126
127 /// @brief Returns time metrics for waits when the worker queues are full
128 /// @return a Time_based_metric_interface object that contains metric
129 /// information on a wait
131
132 /// @brief Returns time metrics for relay log read wait times
133 /// @return a Time_based_metric_interface object that contains metric
134 /// information on a wait
136 override;
137
138 /// @brief Increments the stored values for the commit order metrics.
139 /// @param count The count for commit order waits
140 /// @param time The time waited on commit order
142 int64_t time) override;
143
144 /// @brief Gets the stored number of times we waited on committed order
145 /// @return the stored number of commit order waits
146 int64_t get_number_of_waits_on_commit_order() const override;
147
148 /// @brief Gets the stored summed time waited on commit order
149 /// @return the stored sum of the time waited on commit
150 int64_t get_wait_time_on_commit_order() const override;
151
152 private:
153 /// @brief Tracks the time the applier has been executing
155
156 /// @brief Tracks the number and time waited for transactions to apply
158
159 /// @brief Tracks the number and time waited for transactions to apply
161
162 /// @brief Tracks the number and time waited for transaction dependencies
164
165 /// @brief Tracks the number and time waited for transaction dependencies
167
168 /// @brief Tracks the number and time waited for transaction dependencies
170
171 /// @brief Tracks the number and time waited for transaction dependencies
173};
174} // namespace cs::apply::instruments
175
176#endif /* CHANGESTREAMS_APPLY_METRICS_APPLIER_METRICS_STUB_H */
Abstract class for time based metrics implementations.
Definition: time_based_metric_interface.h:32
Class that intends to be a dummy end point for time metrics.
Definition: time_based_metric_stub.h:30
This abstract class is an interface for classes that contain replication applier data as counters and...
Definition: applier_metrics_interface.h:36
Class that intends to be a dummy end point for applier metrics.
Definition: applier_metrics_stub.h:33
Time_based_metric_interface & get_worker_queues_memory_exceeds_max_wait_metric() override
Returns time metrics for waits when a worker queue exceeds max memory.
Definition: applier_metrics_stub.cc:93
int64_t get_wait_time_on_commit_order() const override
Gets the stored summed time waited on commit order.
Definition: applier_metrics_stub.cc:114
void inc_transactions_committed_count(int64_t amount) override
increment the number of transactions committed.
Definition: applier_metrics_stub.cc:43
void inc_transactions_received_size_sum(int64_t amount) override
increment the pending size of queued transactions.
Definition: applier_metrics_stub.cc:61
int64_t get_total_execution_time() const override
Returns the total time the applier was running.
Definition: applier_metrics_stub.cc:41
void store_last_applier_start() override
Remember "now" as the last applier start time.
Definition: applier_metrics_stub.cc:30
int64_t get_events_committed_count() const override
Gets the number of events scheduled.
Definition: applier_metrics_stub.cc:69
void reset() override
Resets the statistics to zero.
Definition: applier_metrics_stub.cc:28
void inc_transactions_committed_size_sum(int64_t amount) override
increment the size of transactions committed.
Definition: applier_metrics_stub.cc:55
Time_based_metric_stub m_wait_due_to_worker_queue_full
Tracks the number and time waited for transaction dependencies.
Definition: applier_metrics_stub.h:169
Time_based_metric_stub m_wait_for_work_from_source
Tracks the number and time waited for transactions to apply.
Definition: applier_metrics_stub.h:157
Time_based_metric_interface & get_transaction_dependency_wait_metric() override
Returns time metrics for waits on transaction dependecies on workers.
Definition: applier_metrics_stub.cc:88
int64_t get_transactions_committed_size_sum() const override
Gets the total sum of the size of committed transactions.
Definition: applier_metrics_stub.cc:57
int64_t get_transactions_committed_count() const override
Gets the number of transactions committed.
Definition: applier_metrics_stub.cc:45
Time_based_metric_interface & get_worker_queues_full_wait_metric() override
Returns time metrics for waits when the worker queues are full.
Definition: applier_metrics_stub.cc:98
Time_based_metric_interface & get_sum_applier_execution_time() override
Return time metric for total applier execution time.
Definition: applier_metrics_stub.cc:33
int64_t get_transactions_received_count() const override
Gets the number of transactions pending.
Definition: applier_metrics_stub.cc:51
bool is_after_metrics_breakpoint() const override
Definition: applier_metrics_stub.cc:71
Time_based_metric_interface & get_work_from_source_wait_metric() override
Returns time metrics for waits on work from the source.
Definition: applier_metrics_stub.cc:78
void inc_events_committed_count(int64_t v) override
increment the number of events scheduled by a given amount.
Definition: applier_metrics_stub.cc:67
void check_metrics_breakpoint(const char *relay_log_filename) override
Do nothing.
Definition: applier_metrics_stub.cc:75
Time_based_metric_interface & get_workers_available_wait_metric() override
Returns time metrics for waits on available workers.
Definition: applier_metrics_stub.cc:83
Time_based_metric_stub m_wait_due_to_worker_queues_memory_exceeds_max
Tracks the number and time waited for transaction dependencies.
Definition: applier_metrics_stub.h:166
Time_based_metric_interface & get_time_to_read_from_relay_log_metric() override
Returns time metrics for relay log read wait times.
Definition: applier_metrics_stub.cc:103
int64_t get_transactions_received_size_sum() const override
Gets the pending size sum of queued transactions.
Definition: applier_metrics_stub.cc:63
void inc_commit_order_wait_stored_metrics(int64_t count, int64_t time) override
Increments the stored values for the commit order metrics.
Definition: applier_metrics_stub.cc:107
void set_metrics_breakpoint(const char *relay_log_filename) override
Do nothing.
Definition: applier_metrics_stub.cc:73
int64_t get_last_applier_start_micros() const override
Gets the time point when the metric timer started.
Definition: applier_metrics_stub.cc:37
Time_based_metric_stub m_sum_applier_execution_time
Tracks the time the applier has been executing.
Definition: applier_metrics_stub.h:154
Time_based_metric_stub m_wait_for_worker_available
Tracks the number and time waited for transactions to apply.
Definition: applier_metrics_stub.h:160
int64_t get_number_of_waits_on_commit_order() const override
Gets the stored number of times we waited on committed order.
Definition: applier_metrics_stub.cc:110
Time_based_metric_stub m_time_to_read_from_relay_log
Tracks the number and time waited for transaction dependencies.
Definition: applier_metrics_stub.h:172
Time_based_metric_stub m_wait_for_transaction_dependency
Tracks the number and time waited for transaction dependencies.
Definition: applier_metrics_stub.h:163
void inc_transactions_received_count(int64_t amount) override
increment the number of transactions pending.
Definition: applier_metrics_stub.cc:49
static int count
Definition: myisam_ftdump.cc:45
Definition: applier_metrics.cc:27