1 | /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. |
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 as published by |
5 | the Free Software Foundation; version 2 of the License. |
6 | |
7 | This program is distributed in the hope that it will be useful, |
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 | GNU General Public License for more details. |
11 | |
12 | You should have received a copy of the GNU General Public License |
13 | along with this program; if not, write to the Free Software Foundation, |
14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ |
15 | |
16 | #ifndef TABLE_EVENTS_WAITS_SUMMARY_H |
17 | #define TABLE_EVENTS_WAITS_SUMMARY_H |
18 | |
19 | /** |
20 | @file storage/perfschema/table_events_waits_summary.h |
21 | Table EVENTS_WAITS_SUMMARY_BY_xxx (declarations). |
22 | */ |
23 | |
24 | #include "pfs_column_types.h" |
25 | #include "pfs_engine_table.h" |
26 | #include "pfs_instr_class.h" |
27 | #include "pfs_instr.h" |
28 | #include "table_all_instr.h" |
29 | #include "table_helper.h" |
30 | |
31 | /** |
32 | @addtogroup Performance_schema_tables |
33 | @{ |
34 | */ |
35 | |
36 | /** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ |
37 | struct row_events_waits_summary_by_instance |
38 | { |
39 | /** Column EVENT_NAME. */ |
40 | const char *m_name; |
41 | /** Length in bytes of @c m_name. */ |
42 | uint m_name_length; |
43 | /** Column OBJECT_INSTANCE_BEGIN. */ |
44 | intptr m_object_instance_addr; |
45 | /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */ |
46 | PFS_stat_row m_stat; |
47 | }; |
48 | |
49 | /** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ |
50 | class table_events_waits_summary_by_instance : public table_all_instr |
51 | { |
52 | public: |
53 | /** Table share */ |
54 | static PFS_engine_table_share m_share; |
55 | static PFS_engine_table* create(); |
56 | static int delete_all_rows(); |
57 | |
58 | protected: |
59 | void make_instr_row(PFS_instr *pfs, PFS_instr_class *klass, |
60 | const void *object_instance_begin, |
61 | PFS_single_stat *pfs_stat); |
62 | virtual void make_mutex_row(PFS_mutex *pfs); |
63 | virtual void make_rwlock_row(PFS_rwlock *pfs); |
64 | virtual void make_cond_row(PFS_cond *pfs); |
65 | virtual void make_file_row(PFS_file *pfs); |
66 | virtual void make_socket_row(PFS_socket *pfs); |
67 | |
68 | virtual int read_row_values(TABLE *table, |
69 | unsigned char *buf, |
70 | Field **fields, |
71 | bool read_all); |
72 | |
73 | table_events_waits_summary_by_instance(); |
74 | |
75 | public: |
76 | ~table_events_waits_summary_by_instance() |
77 | {} |
78 | |
79 | private: |
80 | /** Table share lock. */ |
81 | static THR_LOCK m_table_lock; |
82 | |
83 | /** Current row. */ |
84 | row_events_waits_summary_by_instance m_row; |
85 | /** True if the current row exists. */ |
86 | bool m_row_exists; |
87 | }; |
88 | |
89 | /** @} */ |
90 | #endif |
91 | |