| 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-1335 USA */ |
| 22 | |
| 23 | #ifndef TABLE_EWS_BY_THREAD_BY_EVENT_NAME_H |
| 24 | #define TABLE_EWS_BY_THREAD_BY_EVENT_NAME_Hcxx . . $ `storage/perfschema/table_ews_by_thread_by_event_name.h:24:9`! |
| 25 | |
| 26 | /** |
| 27 | @file storage/perfschema/table_ews_by_thread_by_event_name.h |
| 28 | Table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME (declarations). |
| 29 | */ |
| 30 | |
| 31 | #include "pfs_column_types.h"cxx . . $ `<file>/storage/perfschema/pfs_column_types.h`/ |
| 32 | #include "pfs_engine_table.h"cxx . . $ `<file>/storage/perfschema/pfs_engine_table.h`/ |
| 33 | #include "pfs_instr_class.h"cxx . . $ `<file>/storage/perfschema/pfs_instr_class.h`/ |
| 34 | #include "pfs_instr.h"cxx . . $ `<file>/storage/perfschema/pfs_instr.h`/ |
| 35 | #include "table_helper.h"cxx . . $ `<file>/storage/perfschema/table_helper.h`/ |
| 36 | |
| 37 | /** |
| 38 | @addtogroup Performance_schema_tables |
| 39 | @{ |
| 40 | */ |
| 41 | |
| 42 | /** |
| 43 | A row of table |
| 44 | PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. |
| 45 | */ |
| 46 | struct row_ews_by_thread_by_event_namecxx . . $ row_ews_by_thread_by_event_name# |
| 47 | { |
| 48 | /** Column THREAD_ID. */ |
| 49 | ulonglongcxx . . $ ulonglong# m_thread_internal_idcxx . . $ row_ews_by_thread_by_event_name#m_thread_internal_id.; |
| 50 | /** Column EVENT_NAME. */ |
| 51 | PFS_event_name_rowcxx . . $ PFS_event_name_row# m_event_namecxx . . $ row_ews_by_thread_by_event_name#m_event_name.; |
| 52 | /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */ |
| 53 | PFS_stat_rowcxx . . $ PFS_stat_row# m_statcxx . . $ row_ews_by_thread_by_event_name#m_stat.; |
| 54 | }; |
| 55 | |
| 56 | /** |
| 57 | Position of a cursor on |
| 58 | PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. |
| 59 | Index 1 on thread (0 based) |
| 60 | Index 2 on instrument view |
| 61 | Index 3 on instrument class (1 based) |
| 62 | */ |
| 63 | struct pos_ews_by_thread_by_event_namecxx . . $ pos_ews_by_thread_by_event_name# |
| 64 | : public PFS_triple_indexcxx . . $ PFS_triple_index#, public PFS_instrument_view_constantscxx . . $ PFS_instrument_view_constants# |
| 65 | { |
| 66 | pos_ews_by_thread_by_event_namecxx . . $ pos_ews_by_thread_by_event_name#pos_ews_by_thread_by_event_name(49f6e7a06ebc5aa8).() |
| 67 | : PFS_triple_indexcxx . . $ PFS_triple_index#PFS_triple_index(6df00707c193238d).(0, FIRST_VIEWcxx . . $ PFS_instrument_view_constants#FIRST_VIEW., 1) |
| 68 | {} |
| 69 | |
| 70 | inline void resetcxx . . $ pos_ews_by_thread_by_event_name#reset(49f6e7a06ebc5aa8).(void) |
| 71 | { |
| 72 | m_index_1cxx . . $ PFS_triple_index#m_index_1.= 0; |
| 73 | m_index_2cxx . . $ PFS_triple_index#m_index_2.= FIRST_VIEWcxx . . $ PFS_instrument_view_constants#FIRST_VIEW.; |
| 74 | m_index_3cxx . . $ PFS_triple_index#m_index_3.= 1; |
| 75 | } |
| 76 | |
| 77 | inline void next_threadcxx . . $ pos_ews_by_thread_by_event_name#next_thread(49f6e7a06ebc5aa8).(void) |
| 78 | { |
| 79 | m_index_1cxx . . $ PFS_triple_index#m_index_1.++; |
| 80 | m_index_2cxx . . $ PFS_triple_index#m_index_2.= FIRST_VIEWcxx . . $ PFS_instrument_view_constants#FIRST_VIEW.; |
| 81 | m_index_3cxx . . $ PFS_triple_index#m_index_3.= 1; |
| 82 | } |
| 83 | |
| 84 | inline bool has_more_viewcxx . . $ pos_ews_by_thread_by_event_name#has_more_view(c9857a73d68e59ba).(void) |
| 85 | { return (m_index_2cxx . . $ PFS_triple_index#m_index_2. <= LAST_VIEWcxx . . $ PFS_instrument_view_constants#LAST_VIEW.); } |
| 86 | |
| 87 | inline void next_viewcxx . . $ pos_ews_by_thread_by_event_name#next_view(49f6e7a06ebc5aa8).(void) |
| 88 | { |
| 89 | m_index_2cxx . . $ PFS_triple_index#m_index_2.++; |
| 90 | m_index_3cxx . . $ PFS_triple_index#m_index_3.= 1; |
| 91 | } |
| 92 | }; |
| 93 | |
| 94 | /** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. */ |
| 95 | class table_ews_by_thread_by_event_namecxx . . $ table_ews_by_thread_by_event_name# : public PFS_engine_tablecxx . . $ PFS_engine_table# |
| 96 | { |
| 97 | public: |
| 98 | static PFS_engine_table_share_statecxx . . $ PFS_engine_table_share_state# m_share_statecxx . . $ table_ews_by_thread_by_event_name#m_share_state.; |
| 99 | /** Table share */ |
| 100 | static PFS_engine_table_sharecxx . . $ PFS_engine_table_share# m_sharecxx . . $ table_ews_by_thread_by_event_name#m_share.; |
| 101 | static PFS_engine_tablecxx . . $ PFS_engine_table#* createcxx . . $ table_ews_by_thread_by_event_name#create(314e88453c9d561a).(); |
| 102 | static int delete_all_rowscxx . . $ table_ews_by_thread_by_event_name#delete_all_rows(b126dc7c1de90089).(); |
| 103 | static ha_rowscxx . . $ ha_rows# get_row_countcxx . . $ table_ews_by_thread_by_event_name#get_row_count(73266883b0c7072b).(); |
| 104 | |
| 105 | int rnd_nextcxx . . $ table_ews_by_thread_by_event_name#rnd_next(b126dc7c1de90089).() override; |
| 106 | int rnd_poscxx . . $ table_ews_by_thread_by_event_name#rnd_pos(aa284d429d6986c8).(const void *pos) override; |
| 107 | void reset_positioncxx . . $ table_ews_by_thread_by_event_name#reset_position(49f6e7a06ebc5aa8).(void) override; |
| 108 | |
| 109 | protected: |
| 110 | int read_row_valuescxx . . $ table_ews_by_thread_by_event_name#read_row_values(139ec8e2a7764e1).(TABLEcxx . . $ TABLE# *table, |
| 111 | unsigned char *buf, |
| 112 | Fieldcxx . . $ Field# **fields, |
| 113 | bool read_all) override; |
| 114 | |
| 115 | table_ews_by_thread_by_event_namecxx . . $ table_ews_by_thread_by_event_name#table_ews_by_thread_by_event_name(49f6e7a06ebc5aa8).(); |
| 116 | |
| 117 | public: |
| 118 | ~cxx . . $ table_ews_by_thread_by_event_name#`~table_ews_by_thread_by_event_name`(ced63f7c635d850d).table_ews_by_thread_by_event_namecxx . . $ table_ews_by_thread_by_event_name#() = default; |
| 119 | |
| 120 | protected: |
| 121 | void make_rowcxx . . $ table_ews_by_thread_by_event_name#make_row(c68e3bba4c70c9dd).(PFS_threadcxx . . $ PFS_thread# *thread, PFS_instr_classcxx . . $ PFS_instr_class# *klass); |
| 122 | |
| 123 | private: |
| 124 | /** Table share lock. */ |
| 125 | static THR_LOCK m_table_lockcxx . . $ table_ews_by_thread_by_event_name#m_table_lock.; |
| 126 | |
| 127 | /** Current row. */ |
| 128 | row_ews_by_thread_by_event_namecxx . . $ row_ews_by_thread_by_event_name# m_rowcxx . . $ table_ews_by_thread_by_event_name#m_row.; |
| 129 | /** True is the current row exists. */ |
| 130 | bool m_row_existscxx . . $ table_ews_by_thread_by_event_name#m_row_exists.; |
| 131 | /** Current position. */ |
| 132 | pos_ews_by_thread_by_event_namecxx . . $ pos_ews_by_thread_by_event_name# m_poscxx . . $ table_ews_by_thread_by_event_name#m_pos.; |
| 133 | /** Next position. */ |
| 134 | pos_ews_by_thread_by_event_namecxx . . $ pos_ews_by_thread_by_event_name# m_next_poscxx . . $ table_ews_by_thread_by_event_name#m_next_pos.; |
| 135 | }; |
| 136 | |
| 137 | /** @} */ |
| 138 | #endif |