summaryrefslogtreecommitdiff
path: root/storage/perfschema/table_ews_global_by_event_name.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-08-01 17:27:34 +0300
committerMichael Widenius <monty@askmonty.org>2012-08-01 17:27:34 +0300
commit1d0f70c2f894b27e98773a282871d32802f67964 (patch)
tree833e683e0ced29c4323c29a9d845703d4dfcd81b /storage/perfschema/table_ews_global_by_event_name.h
parent5a86a61219826aadf8d08cbc447fe438f2bf50c3 (diff)
downloadmariadb-git-1d0f70c2f894b27e98773a282871d32802f67964.tar.gz
Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6
Diffstat (limited to 'storage/perfschema/table_ews_global_by_event_name.h')
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h86
1 files changed, 63 insertions, 23 deletions
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 7e66448e96c..a118e536b6a 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -10,11 +10,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#ifndef TABLE_EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME_H
-#define TABLE_EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME_H
+#ifndef TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
+#define TABLE_EWS_GLOBAL_BY_EVENT_NAME_H
/**
@file storage/perfschema/table_ews_global_by_event_name.h
@@ -25,34 +25,56 @@
#include "pfs_engine_table.h"
#include "pfs_instr_class.h"
#include "pfs_instr.h"
-#include "table_all_instr.h"
+#include "table_helper.h"
/**
@addtogroup Performance_schema_tables
@{
*/
-/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
+/**
+ A row of table
+ PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
+*/
struct row_ews_global_by_event_name
{
/** Column EVENT_NAME. */
- const char *m_name;
- /** Length in bytes of @c m_name. */
- uint m_name_length;
- /** Column COUNT_STAR. */
- ulonglong m_count;
- /** Column SUM_TIMER_WAIT. */
- ulonglong m_sum;
- /** Column MIN_TIMER_WAIT. */
- ulonglong m_min;
- /** Column AVG_TIMER_WAIT. */
- ulonglong m_avg;
- /** Column MAX_TIMER_WAIT. */
- ulonglong m_max;
+ PFS_event_name_row m_event_name;
+ /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
+ PFS_stat_row m_stat;
+};
+
+/**
+ Position of a cursor on
+ PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME.
+ Index 1 on instrument view
+ Index 2 on instrument class (1 based)
+*/
+struct pos_ews_global_by_event_name
+: public PFS_double_index, public PFS_instrument_view_constants
+{
+ pos_ews_global_by_event_name()
+ : PFS_double_index(FIRST_VIEW, 1)
+ {}
+
+ inline void reset(void)
+ {
+ m_index_1= FIRST_VIEW;
+ m_index_2= 1;
+ }
+
+ inline bool has_more_view(void)
+ { return (m_index_1 <= LAST_VIEW); }
+
+ inline void next_view(void)
+ {
+ m_index_1++;
+ m_index_2= 1;
+ }
};
/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
-class table_ews_global_by_event_name : public table_all_instr_class
+class table_ews_global_by_event_name : public PFS_engine_table
{
public:
/** Table share */
@@ -60,9 +82,11 @@ public:
static PFS_engine_table* create();
static int delete_all_rows();
-protected:
- virtual void make_instr_row(PFS_instr_class *klass);
+ virtual int rnd_next();
+ virtual int rnd_pos(const void *pos);
+ virtual void reset_position(void);
+protected:
virtual int read_row_values(TABLE *table,
unsigned char *buf,
Field **fields,
@@ -74,6 +98,16 @@ public:
~table_ews_global_by_event_name()
{}
+protected:
+ void make_mutex_row(PFS_mutex_class *klass);
+ void make_rwlock_row(PFS_rwlock_class *klass);
+ void make_cond_row(PFS_cond_class *klass);
+ void make_file_row(PFS_file_class *klass);
+ void make_table_io_row(PFS_instr_class *klass);
+ void make_table_lock_row(PFS_instr_class *klass);
+ void make_socket_row(PFS_socket_class *klass);
+ void make_idle_row(PFS_instr_class *klass);
+
private:
/** Table share lock. */
static THR_LOCK m_table_lock;
@@ -82,6 +116,12 @@ private:
/** Current row. */
row_ews_global_by_event_name m_row;
+ /** True is the current row exists. */
+ bool m_row_exists;
+ /** Current position. */
+ pos_ews_global_by_event_name m_pos;
+ /** Next position. */
+ pos_ews_global_by_event_name m_next_pos;
};
/** @} */