1
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
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.
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.
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
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16
#ifndef TABLE_EWS_BY_USER_BY_EVENT_NAME_H
17
#define TABLE_EWS_BY_USER_BY_EVENT_NAME_H
20
@file storage/perfschema/table_ews_by_user_by_event_name.h
21
Table EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME (declarations).
24
#include "pfs_column_types.h"
25
#include "pfs_engine_table.h"
26
#include "pfs_instr_class.h"
27
#include "pfs_instr.h"
29
#include "table_helper.h"
32
@addtogroup Performance_schema_tables
38
PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME.
40
struct row_ews_by_user_by_event_name
44
/** Column EVENT_NAME. */
45
PFS_event_name_row m_event_name;
46
/** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
51
Position of a cursor on
52
PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME.
53
Index 1 on user (0 based)
54
Index 2 on instrument view
55
Index 3 on instrument class (1 based)
57
struct pos_ews_by_user_by_event_name
58
: public PFS_triple_index, public PFS_instrument_view_constants
60
pos_ews_by_user_by_event_name()
61
: PFS_triple_index(0, FIRST_VIEW, 1)
64
inline void reset(void)
67
m_index_2= FIRST_VIEW;
71
inline bool has_more_user(void)
72
{ return (m_index_1 < user_max); }
74
inline void next_user(void)
77
m_index_2= FIRST_VIEW;
81
inline bool has_more_view(void)
82
{ return (m_index_2 <= LAST_VIEW); }
84
inline void next_view(void)
91
/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME. */
92
class table_ews_by_user_by_event_name : public PFS_engine_table
96
static PFS_engine_table_share m_share;
97
static PFS_engine_table* create();
98
static int delete_all_rows();
100
virtual int rnd_next();
101
virtual int rnd_pos(const void *pos);
102
virtual void reset_position(void);
105
virtual int read_row_values(TABLE *table,
110
table_ews_by_user_by_event_name();
113
~table_ews_by_user_by_event_name()
117
void make_row(PFS_user *user, PFS_instr_class *klass);
120
/** Table share lock. */
121
static THR_LOCK m_table_lock;
122
/** Fields definition. */
123
static TABLE_FIELD_DEF m_field_def;
126
row_ews_by_user_by_event_name m_row;
127
/** True is the current row exists. */
129
/** Current position. */
130
pos_ews_by_user_by_event_name m_pos;
131
/** Next position. */
132
pos_ews_by_user_by_event_name m_next_pos;