MySQL 9.1.0
Source Code Documentation
dummy_worker_metrics.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
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 CS_DUMMY_WORKER_METRICS_H
25#define CS_DUMMY_WORKER_METRICS_H
26
27#include <cstdint> // int64_t
28#include "worker_metrics.h"
29
30namespace cs::apply::instruments {
31
32/// @brief Class that intends to be a dummy end point for worker metrics
34 public:
36
37 // disable copy assignment operator and the copy constructor
40
41 /// @brief Resets the instruments on this instance.
42 void reset() override;
43
44 /// @brief Returns the type of the currently being processed transaction
45 /// @return If the type is unknown, DML or DDL
47
48 /// @brief Set the type for the transaction being currently processed
49 /// @param type_info what is the type: UNKONWN, DML or DDL
50 void set_transaction_type(Transaction_type_info type_info) override;
51
52 /// @brief set the full size of the ongoing transaction.
53 /// @param amount new size
54 void set_transaction_ongoing_full_size(int64_t amount) override;
55
56 /// @brief Gets the full size of the ongoing transaction
57 /// @return the total size of the ongoing transaction
58 int64_t get_transaction_ongoing_full_size() const override;
59
60 /// @brief increment the executed size of the ongoing transaction.
61 /// @param amount the size amount to increment.
62 void inc_transaction_ongoing_progress_size(int64_t amount) override;
63
64 /// @brief Resets the the executed size of the ongoing transaction to 0
66
67 /// @brief Gets the executed size of the ongoing transaction
68 /// @return the exectuted size of the ongoing transaction
69 int64_t get_transaction_ongoing_progress_size() const override;
70
71 /// @brief Gets the total time waited on commit order
72 /// @return the sum of the time waited on commit
73 int64_t get_wait_time_on_commit_order() const override;
74
75 /// @brief Increments the number of times waited
76 void inc_waited_time_on_commit_order(unsigned long amount) override;
77
78 /// @brief Get the number of time waiting on commit order
79 /// @return the counter of waits on commit order
80 int64_t get_number_of_waits_on_commit_order() const override;
81
82 /// @brief Increments the number of times waited
84};
85} // namespace cs::apply::instruments
86
87#endif /* CS_DUMMY_WORKER_METRICS_H */
Class that intends to be a dummy end point for worker metrics.
Definition: dummy_worker_metrics.h:33
int64_t get_number_of_waits_on_commit_order() const override
Get the number of time waiting on commit order.
Definition: dummy_worker_metrics.cc:64
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:50
Dummy_worker_metrics & operator=(const Dummy_worker_metrics &other)=delete
Dummy_worker_metrics(const Dummy_worker_metrics &other)=delete
int64_t get_wait_time_on_commit_order() const override
Gets the total time waited on commit order.
Definition: dummy_worker_metrics.cc:56
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 inc_number_of_waits_on_commit_order() override
Increments the number of times waited.
Definition: dummy_worker_metrics.cc:68
void inc_waited_time_on_commit_order(unsigned long amount) override
Increments the number of times waited.
Definition: dummy_worker_metrics.cc:60
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:52
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:33
Transaction_type_info
This class helps signaling a transactions as DDL or DML.
Definition: worker_metrics.h:36
Definition: applier_metrics.cc:27