MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
dummy_worker_metrics.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_DUMMY_WORKER_METRICS_H
25#define CHANGESTREAMS_APPLY_METRICS_DUMMY_WORKER_METRICS_H
26
27#include <cstdint> // int64_t
29#include "worker_metrics.h"
30
31namespace cs::apply::instruments {
32
33/// @brief Class that intends to be a dummy end point for worker metrics
35 public:
37
38 // disable copy assignment operator and the copy constructor
41
42 /// @brief Resets the instruments on this instance.
43 void reset() override;
44
45 /// @brief Returns the type of the currently being processed transaction
46 /// @return If the type is unknown, DML or DDL
48
49 /// @brief Set the type for the transaction being currently processed
50 /// @param type_info what is the type: UNKONWN, DML or DDL
51 void set_transaction_type(Transaction_type_info type_info) override;
52
53 /// @brief set the full size of the ongoing transaction.
54 /// @param amount new size
55 void set_transaction_ongoing_full_size(int64_t amount) override;
56
57 /// @brief Gets the full size of the ongoing transaction
58 /// @return the total size of the ongoing transaction
59 int64_t get_transaction_ongoing_full_size() const override;
60
61 /// @brief increment the executed size of the ongoing transaction.
62 /// @param amount the size amount to increment.
63 void inc_transaction_ongoing_progress_size(int64_t amount) override;
64
65 /// @brief Resets the the executed size of the ongoing transaction to 0
67
68 /// @brief Gets the executed size of the ongoing transaction
69 /// @return the exectuted size of the ongoing transaction
70 int64_t get_transaction_ongoing_progress_size() const override;
71
72 /// @brief Gets the total time waited on commit order
73 /// @return the sum of the time waited on commit
75
76 private:
77 /// Stub to return from @c get_waits_due_to_commit_order
79};
80} // namespace cs::apply::instruments
81
82#endif /* CHANGESTREAMS_APPLY_METRICS_DUMMY_WORKER_METRICS_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
Class that intends to be a dummy end point for worker metrics.
Definition: dummy_worker_metrics.h:34
Time_based_metric_interface & get_waits_due_to_commit_order() override
Gets the total time waited on commit order.
Definition: dummy_worker_metrics.cc:55
Worker_metrics::Transaction_type_info get_transaction_type() const override
Returns the type of the currently being processed transaction.
Definition: dummy_worker_metrics.cc:31
void reset_transaction_ongoing_progress_size() override
Resets the the executed size of the ongoing transaction to 0.
Definition: dummy_worker_metrics.cc:48
Dummy_worker_metrics & operator=(const Dummy_worker_metrics &other)=delete
Dummy_worker_metrics(const Dummy_worker_metrics &other)=delete
Time_based_metric_stub m_waits_due_to_commit_order
Stub to return from get_waits_due_to_commit_order.
Definition: dummy_worker_metrics.h:78
void set_transaction_type(Transaction_type_info type_info) override
Set the type for the transaction being currently processed.
Definition: dummy_worker_metrics.cc:35
int64_t get_transaction_ongoing_full_size() const override
Gets the full size of the ongoing transaction.
Definition: dummy_worker_metrics.cc:42
void reset() override
Resets the instruments on this instance.
Definition: dummy_worker_metrics.cc:28
void set_transaction_ongoing_full_size(int64_t amount) override
set the full size of the ongoing transaction.
Definition: dummy_worker_metrics.cc:40
int64_t get_transaction_ongoing_progress_size() const override
Gets the executed size of the ongoing transaction.
Definition: dummy_worker_metrics.cc:50
void inc_transaction_ongoing_progress_size(int64_t amount) override
increment the executed size of the ongoing transaction.
Definition: dummy_worker_metrics.cc:46
Abstract class for classes that contain metrics related to transaction execution in applier workers.
Definition: worker_metrics.h:34
Transaction_type_info
This class helps signaling a transactions as DDL or DML.
Definition: worker_metrics.h:37
Definition: applier_metrics.cc:27