MySQL 8.0.29
Source Code Documentation
table_events_waits_summary.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 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_EVENTS_WAITS_SUMMARY_H
24#define TABLE_EVENTS_WAITS_SUMMARY_H
25
26/**
27 @file storage/perfschema/table_events_waits_summary.h
28 Table EVENTS_WAITS_SUMMARY_BY_xxx (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_inttypes.h"
36
37class Field;
39class Plugin_table;
40struct PFS_cond;
42struct PFS_file;
43struct PFS_instr;
44struct PFS_instr_class;
45struct PFS_mutex;
46struct PFS_rwlock;
47struct PFS_single_stat;
48struct PFS_socket;
49struct TABLE;
50struct THR_LOCK;
51
52/**
53 @addtogroup performance_schema_tables
54 @{
55*/
56
57/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */
59 /** Column EVENT_NAME. */
60 const char *m_name;
61 /** Length in bytes of @c m_name. */
63 /** Column OBJECT_INSTANCE_BEGIN. */
65 /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
67};
68
70 public:
72 : PFS_index_all_instr(&m_key), m_key("OBJECT_INSTANCE_BEGIN") {}
73
75
76 bool match(PFS_mutex *pfs) override;
77 bool match(PFS_rwlock *pfs) override;
78 bool match(PFS_cond *pfs) override;
79 bool match(PFS_file *pfs) override;
80 bool match(PFS_socket *pfs) override;
81
82 private:
84};
85
87 : public PFS_index_all_instr {
88 public:
90 : PFS_index_all_instr(&m_key), m_key("EVENT_NAME") {}
91
93
94 bool match(PFS_mutex *pfs) override;
95 bool match(PFS_rwlock *pfs) override;
96 bool match(PFS_cond *pfs) override;
97 bool match(PFS_file *pfs) override;
98 bool match(PFS_socket *pfs) override;
99 bool match_view(uint view) override;
100
101 private:
103};
104
105/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */
107 public:
108 /** Table share */
111 static int delete_all_rows();
112 int index_init(uint idx, bool sorted) override;
113
114 protected:
115 int make_instr_row(pfs_lock *object_lock, PFS_instr_class *klass,
116 const void *object_instance_begin,
117 PFS_single_stat *pfs_stat);
118 int make_mutex_row(PFS_mutex *pfs) override;
119 int make_rwlock_row(PFS_rwlock *pfs) override;
120 int make_cond_row(PFS_cond *pfs) override;
121 int make_file_row(PFS_file *pfs) override;
122 int make_socket_row(PFS_socket *pfs) override;
123
124 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
125 bool read_all) override;
126
128
129 public:
131
132 private:
133 /** Table share lock. */
135 /** Table definition. */
137
138 /** Current row. */
140};
141
142/** @} */
143#endif
Definition: field.h:573
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_all_instr.h:62
Definition: table_events_waits_summary.h:87
PFS_index_events_waits_summary_by_event_name()
Definition: table_events_waits_summary.h:89
bool match(PFS_mutex *pfs) override
Definition: table_events_waits_summary.cc:126
~PFS_index_events_waits_summary_by_event_name() override=default
PFS_key_event_name m_key
Definition: table_events_waits_summary.h:102
bool match_view(uint view) override
Definition: table_events_waits_summary.cc:186
Definition: table_events_waits_summary.h:69
~PFS_index_events_waits_summary_by_instance() override=default
PFS_key_object_instance m_key
Definition: table_events_waits_summary.h:83
bool match(PFS_mutex *pfs) override
Definition: table_events_waits_summary.cc:81
PFS_index_events_waits_summary_by_instance()
Definition: table_events_waits_summary.h:71
Definition: table_helper.h:1431
Definition: table_helper.h:1673
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Abstract table, a union of all instrumentations instances.
Definition: table_all_instr.h:87
Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE.
Definition: table_events_waits_summary.h:106
int make_socket_row(PFS_socket *pfs) override
Build a row, for socket statistics in a thread.
Definition: table_events_waits_summary.cc:319
int make_mutex_row(PFS_mutex *pfs) override
Build a row, for mutex statistics in a thread.
Definition: table_events_waits_summary.cc:254
int make_rwlock_row(PFS_rwlock *pfs) override
Build a row, for rwlock statistics in a thread.
Definition: table_events_waits_summary.cc:269
static THR_LOCK m_table_lock
Table share lock.
Definition: table_events_waits_summary.h:134
static PFS_engine_table_share m_share
Table share.
Definition: table_events_waits_summary.h:109
row_events_waits_summary_by_instance m_row
Current row.
Definition: table_events_waits_summary.h:139
int make_cond_row(PFS_cond *pfs) override
Build a row, for condition statistics in a thread.
Definition: table_events_waits_summary.cc:284
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_events_waits_summary.cc:340
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_events_waits_summary.cc:193
static int delete_all_rows()
Definition: table_events_waits_summary.cc:198
static Plugin_table m_table_def
Table definition.
Definition: table_events_waits_summary.h:136
int make_instr_row(pfs_lock *object_lock, PFS_instr_class *klass, const void *object_instance_begin, PFS_single_stat *pfs_stat)
Definition: table_events_waits_summary.cc:226
int index_init(uint idx, bool sorted) override
Definition: table_events_waits_summary.cc:208
~table_events_waits_summary_by_instance() override=default
table_events_waits_summary_by_instance()
Definition: table_events_waits_summary.cc:203
int make_file_row(PFS_file *pfs) override
Build a row, for file statistics in a thread.
Definition: table_events_waits_summary.cc:299
Some integer typedefs for easier portability.
intptr_t intptr
Definition: my_inttypes.h:69
Definition: buf0block_hint.cc:29
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
Instrumented condition implementation.
Definition: pfs_instr.h:159
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Instrumented File and FILE implementation.
Definition: pfs_instr.h:176
Information for all instrumentation.
Definition: pfs_instr_class.h:204
Base structure for wait instruments.
Definition: pfs_instr.h:88
Instrumented mutex implementation.
Definition: pfs_instr.h:100
Instrumented rwlock implementation.
Definition: pfs_instr.h:126
Single statistic.
Definition: pfs_stat.h:51
Instrumented socket implementation.
Definition: pfs_instr.h:286
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
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:151
A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE.
Definition: table_events_waits_summary.h:58
uint m_name_length
Length in bytes of m_name.
Definition: table_events_waits_summary.h:62
PFS_stat_row m_stat
Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT.
Definition: table_events_waits_summary.h:66
intptr m_object_instance_addr
Column OBJECT_INSTANCE_BEGIN.
Definition: table_events_waits_summary.h:64
const char * m_name
Column EVENT_NAME.
Definition: table_events_waits_summary.h:60
Abstract tables for all instruments (declarations).
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29