MySQL 8.3.0
Source Code Documentation
pfs_con_slice.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef PFS_CON_SLICE_H
24#define PFS_CON_SLICE_H
25
26/**
27 @file storage/perfschema/pfs_con_slice.h
28 Performance schema connection slice (declarations).
29*/
30
31#include <stddef.h>
32
33#include "lf.h"
36
37struct PFS_single_stat;
38struct PFS_stage_stat;
41struct PFS_error_stat;
42class PFS_opaque_container_page;
43
44/**
45 @addtogroup performance_schema_buffers
46 @{
47*/
48
49/**
50 A connection slice, an arbitrary grouping of several connections.
51 This structure holds statistics for grouping of connections.
52*/
54 /** Reset all statistics. */
55 inline void reset_stats() {
56 m_has_waits_stats = false;
57 m_has_stages_stats = false;
60 m_has_errors_stats = false;
61 m_has_memory_stats = false;
63 }
64
65 /** Reset all wait statistics. */
66 void reset_waits_stats();
67 /** Reset all stages statistics. */
68 void reset_stages_stats();
69 /** Reset all statements statistics. */
71 /** Reset all transactions statistics. */
73 /** Reset all errors statistics. */
74 void reset_errors_stats();
75 /** Reset all status variable statistics. */
77
79 m_has_waits_stats = false;
81 }
82
84 if (!m_has_waits_stats) {
85 return nullptr;
86 }
88 }
89
91 if (!m_has_waits_stats) {
93 m_has_waits_stats = true;
94 }
96 }
97
99 m_has_stages_stats = false;
101 }
102
104 if (!m_has_stages_stats) {
105 return nullptr;
106 }
108 }
109
111 if (!m_has_stages_stats) {
113 m_has_stages_stats = true;
114 }
116 }
117
121 }
122
125 return nullptr;
126 }
128 }
129
134 }
136 }
137
141 }
142
145 return nullptr;
146 }
148 }
149
154 }
156 }
157
159 m_has_errors_stats = false;
161 }
162
164 if (!m_has_errors_stats) {
165 return nullptr;
166 }
168 }
169
171 if (!m_has_errors_stats) {
173 m_has_errors_stats = true;
174 }
176 }
177
178 protected:
180
181 private:
187
188 /**
189 Per connection slice waits aggregated statistics.
190 This member holds the data for the table
191 PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_*_BY_EVENT_NAME.
192 Immutable, safe to use without internal lock.
193 */
195
196 /**
197 Per connection slice stages aggregated statistics.
198 This member holds the data for the table
199 PERFORMANCE_SCHEMA.EVENTS_STAGES_SUMMARY_BY_*_BY_EVENT_NAME.
200 Immutable, safe to use without internal lock.
201 */
203
204 /**
205 Per connection slice statements aggregated statistics.
206 This member holds the data for the table
207 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_*_BY_EVENT_NAME.
208 Immutable, safe to use without internal lock.
209 */
211
212 /**
213 Per connection slice transactions aggregated statistics.
214 This member holds the data for the table
215 PERFORMANCE_SCHEMA.EVENTS_TRANSACTIONS_SUMMARY_BY_*_BY_EVENT_NAME.
216 Immutable, safe to use without internal lock.
217 */
219
220 /**
221 Per connection slice error aggregated statistics.
222 This member holds the data for the table
223 PERFORMANCE_SCHEMA.EVENTS_ERRORS_SUMMARY_BY_*_BY_ERROR.
224 Immutable, safe to use without internal lock.
225 */
227
228 public:
231 }
232
233 /**
234 Aggregated status variables.
235 */
237
238 /** Container page. */
239 PFS_opaque_container_page *m_page;
240};
241
242/** @} */
243#endif
void reset_stages_stats()
Reset all stages statistics.
Definition: pfs_con_slice.cc:48
void reset_errors_stats()
Reset all errors statistics.
Definition: pfs_con_slice.cc:72
void reset_statements_stats()
Reset all statements statistics.
Definition: pfs_con_slice.cc:56
void reset_waits_stats()
Reset all wait statistics.
Definition: pfs_con_slice.cc:40
void reset_transactions_stats()
Reset all transactions statistics.
Definition: pfs_con_slice.cc:64
SHOW_VAR status_vars[]
Definition: mysqld.cc:11457
Performance schema internal locks (declarations).
Status variables statistics (declarations).
A connection slice, an arbitrary grouping of several connections.
Definition: pfs_con_slice.h:53
bool m_has_memory_stats
Definition: pfs_con_slice.h:179
PFS_error_stat * m_instr_class_errors_stats
Per connection slice error aggregated statistics.
Definition: pfs_con_slice.h:226
bool m_has_stages_stats
Definition: pfs_con_slice.h:183
PFS_single_stat * write_instr_class_waits_stats()
Definition: pfs_con_slice.h:90
const PFS_error_stat * read_instr_class_errors_stats() const
Definition: pfs_con_slice.h:163
void aggregate_status_stats(const System_status_var *status_vars)
Definition: pfs_con_slice.h:229
PFS_single_stat * m_instr_class_waits_stats
Per connection slice waits aggregated statistics.
Definition: pfs_con_slice.h:194
bool m_has_transactions_stats
Definition: pfs_con_slice.h:185
const PFS_single_stat * read_instr_class_waits_stats() const
Definition: pfs_con_slice.h:83
const PFS_transaction_stat * read_instr_class_transactions_stats() const
Definition: pfs_con_slice.h:143
void set_instr_class_waits_stats(PFS_single_stat *array)
Definition: pfs_con_slice.h:78
PFS_error_stat * write_instr_class_errors_stats()
Definition: pfs_con_slice.h:170
void set_instr_class_stages_stats(PFS_stage_stat *array)
Definition: pfs_con_slice.h:98
void reset_status_stats()
Reset all status variable statistics.
Definition: pfs_con_slice.h:76
void set_instr_class_statements_stats(PFS_statement_stat *array)
Definition: pfs_con_slice.h:118
PFS_transaction_stat * m_instr_class_transactions_stats
Per connection slice transactions aggregated statistics.
Definition: pfs_con_slice.h:218
PFS_stage_stat * m_instr_class_stages_stats
Per connection slice stages aggregated statistics.
Definition: pfs_con_slice.h:202
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_con_slice.h:239
PFS_statement_stat * m_instr_class_statements_stats
Per connection slice statements aggregated statistics.
Definition: pfs_con_slice.h:210
const PFS_statement_stat * read_instr_class_statements_stats() const
Definition: pfs_con_slice.h:123
bool m_has_waits_stats
Definition: pfs_con_slice.h:182
PFS_status_stats m_status_stats
Aggregated status variables.
Definition: pfs_con_slice.h:236
PFS_transaction_stat * write_instr_class_transactions_stats()
Definition: pfs_con_slice.h:150
bool m_has_errors_stats
Definition: pfs_con_slice.h:186
void set_instr_class_errors_stats(PFS_error_stat *array)
Definition: pfs_con_slice.h:158
const PFS_stage_stat * read_instr_class_stages_stats() const
Definition: pfs_con_slice.h:103
bool m_has_statements_stats
Definition: pfs_con_slice.h:184
PFS_stage_stat * write_instr_class_stages_stats()
Definition: pfs_con_slice.h:110
void reset_stats()
Reset all statistics.
Definition: pfs_con_slice.h:55
void set_instr_class_transactions_stats(PFS_transaction_stat *array)
Definition: pfs_con_slice.h:138
PFS_statement_stat * write_instr_class_statements_stats()
Definition: pfs_con_slice.h:130
Statistics for all server errors.
Definition: pfs_stat.h:556
Single statistic.
Definition: pfs_stat.h:51
Statistics for stage usage.
Definition: pfs_stat.h:322
Statistics for statement usage.
Definition: pfs_stat.h:375
Definition: pfs_status.h:34
void aggregate_from(const System_status_var *from)
Definition: pfs_status.cc:59
void reset()
Definition: pfs_status.cc:45
Statistics for transaction usage.
Definition: pfs_stat.h:458
Per thread status variables.
Definition: system_variables.h:525