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