MySQL 8.0.29
Source Code Documentation
table_ews_global_by_event_name.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 2022, 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 TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
24#define TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
25
26/**
27 @file storage/perfschema/table_ews_global_by_event_name.h
28 Table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
36
37class Field;
38class Plugin_table;
39struct PFS_cond_class;
40struct PFS_file_class;
41struct PFS_instr_class;
42struct PFS_mutex_class;
43struct PFS_rwlock_class;
44struct PFS_socket_class;
45struct TABLE;
46struct THR_LOCK;
47
48/**
49 @addtogroup performance_schema_tables
50 @{
51*/
52
54 public:
56 : PFS_engine_index(&m_key), m_key("EVENT_NAME") {}
57
59
60 virtual bool match_view(uint view);
61 virtual bool match(PFS_instr_class *instr_class);
62
63 private:
65};
66
67/**
68 A row of table
69 PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
70*/
72 /** Column EVENT_NAME. */
74 /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
76};
77
78/**
79 Position of a cursor on
80 PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
81 Index 1 on instrument view
82 Index 2 on instrument class (1 based)
83*/
87
88 inline void reset(void) {
90 m_index_2 = 1;
91 }
92
93 inline bool has_more_view(void) { return (m_index_1 <= LAST_VIEW); }
94
95 inline void next_view(void) {
96 m_index_1++;
97 m_index_2 = 1;
98 }
99};
100
101/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
103 public:
104 /** Table share */
107 static int delete_all_rows();
108 static ha_rows get_row_count();
109
110 void reset_position(void) override;
111
112 int rnd_next() override;
113 int rnd_pos(const void *pos) override;
114
115 int index_init(uint idx, bool sorted) override;
116 int index_next(void) override;
117
118 protected:
119 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
120 bool read_all) override;
121
123
124 public:
126
127 protected:
130 int make_cond_row(PFS_cond_class *klass);
131 int make_file_row(PFS_file_class *klass);
135 int make_idle_row(PFS_instr_class *klass);
137
138 private:
139 /** Table share lock. */
141 /** Table definition. */
143
144 /** Current row. */
146 /** Current position. */
148 /** Next position. */
150
152};
153/** @} */
154#endif
Definition: field.h:573
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_ews_global_by_event_name.h:53
PFS_index_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.h:55
PFS_key_event_name m_key
Definition: table_ews_global_by_event_name.h:64
virtual bool match(PFS_instr_class *instr_class)
Definition: table_ews_global_by_event_name.cc:87
~PFS_index_ews_global_by_event_name() override=default
virtual bool match_view(uint view)
Definition: table_ews_global_by_event_name.cc:80
Definition: table_helper.h:1431
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:102
static Plugin_table m_table_def
Table definition.
Definition: table_ews_global_by_event_name.h:142
int make_rwlock_row(PFS_rwlock_class *klass)
Definition: table_ews_global_by_event_name.cc:415
~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:124
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:506
static int delete_all_rows()
Definition: table_ews_global_by_event_name.cc:101
static ha_rows get_row_count()
Definition: table_ews_global_by_event_name.cc:109
int make_cond_row(PFS_cond_class *klass)
Definition: table_ews_global_by_event_name.cc:425
static PFS_engine_table_share m_share
Table share.
Definition: table_ews_global_by_event_name.h:105
int make_idle_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:476
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_ews_global_by_event_name.cc:201
int make_table_lock_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:455
int make_socket_row(PFS_socket_class *klass)
Definition: table_ews_global_by_event_name.cc:466
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_ews_global_by_event_name.cc:119
static THR_LOCK m_table_lock
Table share lock.
Definition: table_ews_global_by_event_name.h:140
pos_ews_global_by_event_name m_next_pos
Next position.
Definition: table_ews_global_by_event_name.h:149
row_ews_global_by_event_name m_row
Current row.
Definition: table_ews_global_by_event_name.h:145
int make_metadata_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:492
PFS_index_ews_global_by_event_name * m_opened_index
Definition: table_ews_global_by_event_name.h:151
pos_ews_global_by_event_name m_pos
Current position.
Definition: table_ews_global_by_event_name.h:147
int make_table_io_row(PFS_instr_class *klass)
Definition: table_ews_global_by_event_name.cc:445
int index_init(uint idx, bool sorted) override
Definition: table_ews_global_by_event_name.cc:271
int make_mutex_row(PFS_mutex_class *klass)
Definition: table_ews_global_by_event_name.cc:405
int make_file_row(PFS_file_class *klass)
Definition: table_ews_global_by_event_name.cc:435
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_ews_global_by_event_name.cc:96
table_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.cc:113
int index_next(void) override
Find key in index, read record.
Definition: table_ews_global_by_event_name.cc:281
char * pos
Definition: do_ctype.cc:76
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:320
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:593
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:595
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:597
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for column EVENT_NAME.
Definition: table_helper.h:596
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:518
Information for all instrumentation.
Definition: pfs_instr_class.h:204
Name space, internal views used within table setup_instruments.
Definition: table_helper.h:503
static const uint LAST_VIEW
Definition: table_helper.h:515
static const uint FIRST_VIEW
Definition: table_helper.h:506
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:300
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:310
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:547
Row fragment for single statistics columns (COUNT, SUM, MIN, AVG, MAX)
Definition: table_helper.h:675
Definition: table.h:1394
Definition: thr_lock.h:138
Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:85
pos_ews_global_by_event_name()
Definition: table_ews_global_by_event_name.h:86
void reset(void)
Definition: table_ews_global_by_event_name.h:88
bool has_more_view(void)
Definition: table_ews_global_by_event_name.h:93
void next_view(void)
Definition: table_ews_global_by_event_name.h:95
A row of table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
Definition: table_ews_global_by_event_name.h:71
PFS_event_name_row m_event_name
Column EVENT_NAME.
Definition: table_ews_global_by_event_name.h:73
PFS_stat_row m_stat
Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT.
Definition: table_ews_global_by_event_name.h:75
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29