MySQL 9.0.0
Source Code Documentation
table_ews_global_by_event_name.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 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 TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
25#define TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
26
27/**
28 @file storage/perfschema/table_ews_global_by_event_name.h
29 Table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_cond_class;
41struct PFS_file_class;
42struct PFS_instr_class;
43struct PFS_mutex_class;
44struct PFS_rwlock_class;
45struct PFS_socket_class;
46struct TABLE;
47struct THR_LOCK;
48
49/**
50 @addtogroup performance_schema_tables
51 @{
52*/
53
55 public:
57 : PFS_engine_index(&m_key), m_key("EVENT_NAME") {}
58
60
61 virtual bool match_view(uint view);
62 virtual bool match(PFS_instr_class *instr_class);
63
64 private:
66};
67
68/**
69 A row of table
70 PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
71*/
73 /** Column EVENT_NAME. */
75 /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
77};
78
79/**
80 Position of a cursor on
81 PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
82 Index 1 on instrument view
83 Index 2 on instrument class (1 based)
84*/
88
89 inline void reset() {
91 m_index_2 = 1;
92 }
93
94 inline bool has_more_view() { return (m_index_1 <= LAST_VIEW); }
95
96 inline void next_view() {
97 m_index_1++;
98 m_index_2 = 1;
99 }
100};
101
102/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
104 public:
105 /** Table share */
108 static int delete_all_rows();
109 static ha_rows get_row_count();
110
111 void reset_position() override;
112
113 int rnd_next() override;
114 int rnd_pos(const void *pos) override;
115
116 int index_init(uint idx, bool sorted) override;
117 int index_next() override;
118
119 protected:
120 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
121 bool read_all) override;
122
124
125 public:
127
128 protected:
131 int make_cond_row(PFS_cond_class *klass);
132 int make_file_row(PFS_file_class *klass);
136 int make_idle_row(PFS_instr_class *klass);
138
139 private:
140 /** Table share lock. */
142 /** Table definition. */
144
145 /** Current row. */
147 /** Current position. */
149 /** Next position. */
151
153};
154/** @} */
155#endif
Definition: field.h:577
Definition: pfs_engine_table.h:300
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_ews_global_by_event_name.h:54
PFS_index_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.h:56
PFS_key_event_name m_key
Definition: table_ews_global_by_event_name.h:65
virtual bool match(PFS_instr_class *instr_class)
Definition: table_ews_global_by_event_name.cc:88
~PFS_index_ews_global_by_event_name() override=default
virtual bool match_view(uint view)
Definition: table_ews_global_by_event_name.cc:81
Definition: table_helper.h:1461
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:103
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_ews_global_by_event_name.cc:120
static Plugin_table m_table_def
Table definition.
Definition: table_ews_global_by_event_name.h:143
int make_rwlock_row(PFS_rwlock_class *klass)
Definition: table_ews_global_by_event_name.cc:412
~table_ews_global_by_event_name() override=default
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_ews_global_by_event_name.cc:125
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_ews_global_by_event_name.cc:503
static int delete_all_rows()
Definition: table_ews_global_by_event_name.cc:102
static ha_rows get_row_count()
Definition: table_ews_global_by_event_name.cc:110
int make_cond_row(PFS_cond_class *klass)
Definition: table_ews_global_by_event_name.cc:422
static PFS_engine_table_share m_share
Table share.
Definition: table_ews_global_by_event_name.h:106
int make_idle_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:473
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ews_global_by_event_name.cc:202
int make_table_lock_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:452
int make_socket_row(PFS_socket_class *klass)
Definition: table_ews_global_by_event_name.cc:463
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ews_global_by_event_name.h:141
pos_ews_global_by_event_name m_next_pos
Next position.
Definition: table_ews_global_by_event_name.h:150
row_ews_global_by_event_name m_row
Current row.
Definition: table_ews_global_by_event_name.h:146
int make_metadata_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:489
PFS_index_ews_global_by_event_name * m_opened_index
Definition: table_ews_global_by_event_name.h:152
pos_ews_global_by_event_name m_pos
Current position.
Definition: table_ews_global_by_event_name.h:148
int make_table_io_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:442
int index_next() override
Find key in index, read record.
Definition: table_ews_global_by_event_name.cc:279
int index_init(uint idx, bool sorted) override
Definition: table_ews_global_by_event_name.cc:270
int make_mutex_row(PFS_mutex_class *klass)
Definition: table_ews_global_by_event_name.cc:402
int make_file_row(PFS_file_class *klass)
Definition: table_ews_global_by_event_name.cc:432
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ews_global_by_event_name.cc:97
table_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.cc:114
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:347
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:601
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:603
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:605
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Row fragment for column EVENT_NAME.
Definition: table_helper.h:583
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:587
Information for all instrumentation.
Definition: pfs_instr_class.h:212
Name space, internal views used within table setup_instruments.
Definition: table_helper.h:490
static const uint LAST_VIEW
Definition: table_helper.h:502
static const uint FIRST_VIEW
Definition: table_helper.h:493
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:327
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:337
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:616
Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX)
Definition: table_helper.h:689
Definition: table.h:1407
Definition: thr_lock.h:139
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:86
void next_view()
Definition: table_ews_global_by_event_name.h:96
bool has_more_view()
Definition: table_ews_global_by_event_name.h:94
pos_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.h:87
void reset()
Definition: table_ews_global_by_event_name.h:89
A row of table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:72
PFS_event_name_row m_event_name
Column EVENT_NAME.
Definition: table_ews_global_by_event_name.h:74
PFS_stat_row m_stat
Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT.
Definition: table_ews_global_by_event_name.h:76
Helpers to implement a performance schema table.