MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_events_waits.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2011, 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_H
17 #define TABLE_EVENTS_WAITS_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_engine_table.h"
26 #include "pfs_events_waits.h"
27 
28 struct PFS_thread;
29 
37 {
41  ulonglong m_event_id;
43  ulonglong m_end_event_id;
45  ulonglong m_nesting_event_id;
49  const char *m_name;
53  ulonglong m_timer_start;
55  ulonglong m_timer_end;
57  ulonglong m_timer_wait;
59  const char *m_object_type;
83  ulonglong m_number_of_bytes;
85  uint m_flags;
86 };
87 
90 {
92  : PFS_double_index(0, 0)
93  {}
94 
95  inline void reset(void)
96  {
97  m_index_1= 0;
98  m_index_2= 0;
99  }
100 
101  inline void next_thread(void)
102  {
103  m_index_1++;
104  m_index_2= 0;
105  }
106 };
107 
110 {
112  : PFS_double_index(0, 0)
113  {}
114 
115  inline void reset(void)
116  {
117  m_index_1= 0;
118  m_index_2= 0;
119  }
120 
121  inline void next_thread(void)
122  {
123  m_index_1++;
124  m_index_2= 0;
125  }
126 };
127 
133 {
134 protected:
135  virtual int read_row_values(TABLE *table,
136  unsigned char *buf,
137  Field **fields,
138  bool read_all);
139 
140  table_events_waits_common(const PFS_engine_table_share *share, void *pos);
141 
143  {}
144 
145  void clear_object_columns();
146  int make_table_object_columns(volatile PFS_events_waits *wait);
147  int make_file_object_columns(volatile PFS_events_waits *wait);
148  int make_socket_object_columns(volatile PFS_events_waits *wait);
149 
150  void make_row(bool thread_own_wait, PFS_thread *pfs_thread,
151  volatile PFS_events_waits *wait);
152 
157 };
158 
161 {
162 public:
165  static PFS_engine_table* create();
166  static int delete_all_rows();
167 
168  virtual int rnd_next();
169  virtual int rnd_pos(const void *pos);
170  virtual void reset_position(void);
171 
172 protected:
174 
175 public:
177  {}
178 
179 private:
180  friend class table_events_waits_history;
181  friend class table_events_waits_history_long;
182 
184  static THR_LOCK m_table_lock;
190  static TABLE_FIELD_DEF m_field_def;
191 
195  pos_events_waits_current m_next_pos;
196 };
197 
200 {
201 public:
204  static PFS_engine_table* create();
205  static int delete_all_rows();
206 
207  virtual int rnd_next();
208  virtual int rnd_pos(const void *pos);
209  virtual void reset_position(void);
210 
211 protected:
213 
214 public:
216  {}
217 
218 private:
220  static THR_LOCK m_table_lock;
221 
225  pos_events_waits_history m_next_pos;
226 };
227 
230 {
231 public:
234  static PFS_engine_table* create();
235  static int delete_all_rows();
236 
237  virtual int rnd_next();
238  virtual int rnd_pos(const void *pos);
239  virtual void reset_position(void);
240 
241 protected:
243 
244 public:
246  {}
247 
248 private:
250  static THR_LOCK m_table_lock;
251 
253  PFS_simple_index m_pos;
255  PFS_simple_index m_next_pos;
256 };
257 
259 #endif