#At file:///home/malff/BZR-TREE/mysql-6.0-perf/
2743 Marc Alff 2008-11-24
Preparing for performance mesurements
added:
storage/perfschema/unittest/conf.txt
modified:
mysql-test/suite/perfschema/r/start_server_off.result
mysql-test/suite/perfschema/r/start_server_on.result
mysql-test/suite/perfschema/t/start_server_off.test
mysql-test/suite/perfschema/t/start_server_on.test
storage/perfschema/table_setup_timers.cc
storage/perfschema/unittest/Makefile.am
=== modified file 'mysql-test/suite/perfschema/r/start_server_off.result'
--- a/mysql-test/suite/perfschema/r/start_server_off.result 2008-11-22 00:28:06 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_off.result 2008-11-25 00:58:32 +0000
@@ -7,3 +7,61 @@ test
select if (version() like "%perfschema%", "Compiled In", "Compiled Out");
if (version() like "%perfschema%", "Compiled In", "Compiled Out")
Compiled In
+show engine performance_schema status;
+Type Name Status
+performance_schema ACTS_WAITS_CURRENT.ROW_SIZE 80
+performance_schema ACTS_WAITS_CURRENT.ROW_COUNT 0
+performance_schema ACTS_WAITS_HISTORY.ROW_SIZE 64
+performance_schema ACTS_WAITS_HISTORY.ROW_COUNT 0
+performance_schema ACTS_WAITS_HISTORY_LONG.ROW_SIZE 64
+performance_schema ACTS_WAITS_HISTORY_LONG.ROW_COUNT 10000
+performance_schema ACTS_WAITS_HISTORY_LONG.MEMORY 640000
+performance_schema SETUP_INSTRUMENTS.ROW_SIZE 80
+performance_schema SETUP_INSTRUMENTS.ROW_COUNT 0
+performance_schema SETUP_INSTRUMENTS.ROW_LOST 0
+performance_schema SETUP_INSTRUMENTS.MEMORY 0
+performance_schema (PSE_MUTEX).ROW_SIZE 40
+performance_schema (PSE_MUTEX).ROW_COUNT 0
+performance_schema (PSE_MUTEX).ROW_LOST 0
+performance_schema (PSE_MUTEX).MEMORY 0
+performance_schema (PSE_RWLOCK).ROW_SIZE 48
+performance_schema (PSE_RWLOCK).ROW_COUNT 0
+performance_schema (PSE_RWLOCK).ROW_LOST 0
+performance_schema (PSE_RWLOCK).MEMORY 0
+performance_schema (PSE_COND).ROW_SIZE 40
+performance_schema (PSE_COND).ROW_COUNT 0
+performance_schema (PSE_COND).ROW_LOST 0
+performance_schema (PSE_COND).MEMORY 0
+performance_schema (PSE_THREAD).ROW_SIZE 936
+performance_schema (PSE_THREAD).ROW_COUNT 0
+performance_schema (PSE_THREAD).ROW_LOST 0
+performance_schema (PSE_THREAD).MEMORY 0
+performance_schema PERFORMANCE_SCHEMA.MEMORY 640000
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+3
+select count(*) from performance_schema.setup_instruments;
+count(*)
+0
+select count(*) from performance_schema.setup_timers;
+count(*)
+1
+select * from performance_schema.setup_consumers;
+NAME ENABLED NUMBER_OF_ROWS_FILLED
+acts_waits_current YES 0
+acts_waits_history YES 0
+acts_waits_history_long YES 0
+select * from performance_schema.setup_instruments;
+NAME ENABLED TIMED
+select * from performance_schema.setup_timers;
+NAME TIMER_NAME
+Wait CYCLE
+select * from performance_schema.acts_waits_current;
+THREAD_ID ACT_ID ACT_NAME TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN
+select * from performance_schema.acts_waits_history;
+THREAD_ID ACT_ID ACT_NAME TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN
+select * from performance_schema.acts_waits_history_long;
+THREAD_ID ACT_ID ACT_NAME TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME OBJECT_INSTANCE_BEGIN
=== modified file 'mysql-test/suite/perfschema/r/start_server_on.result'
--- a/mysql-test/suite/perfschema/r/start_server_on.result 2008-11-22 00:28:06 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_on.result 2008-11-25 00:58:32 +0000
@@ -7,3 +7,45 @@ test
select if (version() like "%perfschema%", "Compiled In", "Compiled Out");
if (version() like "%perfschema%", "Compiled In", "Compiled Out")
Compiled In
+show engine performance_schema status;
+Type Name Status
+performance_schema ACTS_WAITS_CURRENT.ROW_SIZE 80
+performance_schema ACTS_WAITS_CURRENT.ROW_COUNT 3000
+performance_schema ACTS_WAITS_HISTORY.ROW_SIZE 64
+performance_schema ACTS_WAITS_HISTORY.ROW_COUNT 10000
+performance_schema ACTS_WAITS_HISTORY_LONG.ROW_SIZE 64
+performance_schema ACTS_WAITS_HISTORY_LONG.ROW_COUNT 10000
+performance_schema ACTS_WAITS_HISTORY_LONG.MEMORY 640000
+performance_schema SETUP_INSTRUMENTS.ROW_SIZE 80
+performance_schema SETUP_INSTRUMENTS.ROW_COUNT 1000
+performance_schema SETUP_INSTRUMENTS.ROW_LOST 0
+performance_schema SETUP_INSTRUMENTS.MEMORY 80000
+performance_schema (PSE_MUTEX).ROW_SIZE 40
+performance_schema (PSE_MUTEX).ROW_COUNT 1000
+performance_schema (PSE_MUTEX).ROW_LOST 0
+performance_schema (PSE_MUTEX).MEMORY 40000
+performance_schema (PSE_RWLOCK).ROW_SIZE 48
+performance_schema (PSE_RWLOCK).ROW_COUNT 1000
+performance_schema (PSE_RWLOCK).ROW_LOST 0
+performance_schema (PSE_RWLOCK).MEMORY 48000
+performance_schema (PSE_COND).ROW_SIZE 40
+performance_schema (PSE_COND).ROW_COUNT 1000
+performance_schema (PSE_COND).ROW_LOST 0
+performance_schema (PSE_COND).MEMORY 40000
+performance_schema (PSE_THREAD).ROW_SIZE 936
+performance_schema (PSE_THREAD).ROW_COUNT 1000
+performance_schema (PSE_THREAD).ROW_LOST 0
+performance_schema (PSE_THREAD).MEMORY 936000
+performance_schema PERFORMANCE_SCHEMA.MEMORY 1784000
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+3
+select count(*) from performance_schema.setup_instruments;
+count(*)
+175
+select count(*) from performance_schema.setup_timers;
+count(*)
+1
=== modified file 'mysql-test/suite/perfschema/t/start_server_off.test'
--- a/mysql-test/suite/perfschema/t/start_server_off.test 2008-11-22 00:28:06 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_off.test 2008-11-25 00:58:32 +0000
@@ -3,3 +3,18 @@ show databases;
select if (version() like "%perfschema%", "Compiled In", "Compiled Out");
+show engine performance_schema status;
+
+select count(*) from performance_schema.performance_timers;
+select count(*) from performance_schema.setup_consumers;
+select count(*) from performance_schema.setup_instruments;
+select count(*) from performance_schema.setup_timers;
+
+-- Make sure we don't crash when no memory is allocated
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.acts_waits_current;
+select * from performance_schema.acts_waits_history;
+select * from performance_schema.acts_waits_history_long;
+
=== modified file 'mysql-test/suite/perfschema/t/start_server_on.test'
--- a/mysql-test/suite/perfschema/t/start_server_on.test 2008-11-22 00:28:06 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_on.test 2008-11-25 00:58:32 +0000
@@ -3,3 +3,10 @@ show databases;
select if (version() like "%perfschema%", "Compiled In", "Compiled Out");
+show engine performance_schema status;
+
+select count(*) from performance_schema.performance_timers;
+select count(*) from performance_schema.setup_consumers;
+select count(*) from performance_schema.setup_instruments;
+select count(*) from performance_schema.setup_timers;
+
=== modified file 'storage/perfschema/table_setup_timers.cc'
--- a/storage/perfschema/table_setup_timers.cc 2008-11-17 23:04:33 +0000
+++ b/storage/perfschema/table_setup_timers.cc 2008-11-25 00:58:32 +0000
@@ -144,6 +144,7 @@ int table_setup_timers::update_row_value
{
Field *f;
Field_enum *col_timer_name;
+ int value;
DBUG_ASSERT(m_row);
@@ -160,8 +161,13 @@ int table_setup_timers::update_row_value
break;
case 1:
DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM);
+ DBUG_ASSERT(! f->is_null());
col_timer_name= (Field_enum*) f;
- *(m_row->m_timer_name_ptr)= (enum_timer_name) col_timer_name->val_int();
+ value= col_timer_name->val_int();
+ if ((value >= FIRST_TIMER_NAME) && (value <= LAST_TIMER_NAME))
+ *(m_row->m_timer_name_ptr)= (enum_timer_name) value;
+ else
+ return HA_ERR_WRONG_COMMAND;
break;
default:
DBUG_ASSERT(false);
=== modified file 'storage/perfschema/unittest/Makefile.am'
--- a/storage/perfschema/unittest/Makefile.am 2008-10-10 20:34:55 +0000
+++ b/storage/perfschema/unittest/Makefile.am 2008-11-25 00:58:32 +0000
@@ -20,3 +20,5 @@ INCLUDES = @ZLIB_INCLUDES@ -I$(t
-I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
+EXTRA_DIST = conf.txt
+
=== added file 'storage/perfschema/unittest/conf.txt'
--- a/storage/perfschema/unittest/conf.txt 1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/unittest/conf.txt 2008-11-25 00:58:32 +0000
@@ -0,0 +1,380 @@
+
+Performance schema test configurations.
+(Used internally for performance testing)
+
+Configuration PERFSCHEMA-COMPILED-OUT
+=====================================
+
+Description
+-----------
+
+Reference for timings, server built without the performance schema.
+
+Compiling options
+-----------------
+
+./configure --without-perfschema
+
+Server start options
+--------------------
+
+N/A
+
+Configuration
+-------------
+
+N/A
+
+Pre-test queries
+----------------
+
+select version();
+
+This is just to make sure the build is not including the performance schema.
+
+Post-test queries
+-----------------
+
+N/A
+
+Configuration PERFSCHEMA-DISABLED
+=================================
+
+Description
+-----------
+
+Server built with the performance schema,
+but the performance schema is disabled at startup.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=false
+
+Configuration
+-------------
+
+N/A
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+N/A
+
+Configuration PERFSCHEMA-ENABLED-STANDBY
+========================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup,
+but configured to not record anything.
+This is a "stanby" configuration, in the sense that the DBA can add
+dynamically more setup options later to get data.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='NO', timed='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='NO';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
+Configuration PERFSCHEMA-ENABLED-CURRENT
+========================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup.
+All instruments are enabled but not timed,
+and only one consumer (ACTS_WAITS_CURRENT) is set.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='YES', timed='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_CURRENT';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
+Configuration PERFSCHEMA-ENABLED-CURRENT-CYCLE
+==============================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup.
+All instruments are enabled and timed,
+and only one consumer (ACTS_WAITS_CURRENT) is set.
+The timer used is CYCLE.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='YES', timed='YES';
+
+UPDATE performance_schema.setup_timers
+ set timer_name='CYCLE';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_CURRENT';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
+Configuration PERFSCHEMA-ENABLED-HISTORY-CYCLE
+==============================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup.
+All instruments are enabled and timed, in CYCLE.
+Two consumers (ACTS_WAITS_CURRENT, ACTS_WAITS_HISTORY) are set.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='YES', timed='YES';
+
+UPDATE performance_schema.setup_timers
+ set timer_name='CYCLE';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_CURRENT';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_HISTORY';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
+Configuration PERFSCHEMA-ENABLED-HISTORY_LONG-CYCLE
+===================================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup.
+All instruments are enabled and timed, in CYCLE.
+Two consumers (ACTS_WAITS_CURRENT, ACTS_WAITS_HISTORY_LONG) are set.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='YES', timed='YES';
+
+UPDATE performance_schema.setup_timers
+ set timer_name='CYCLE';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='NO';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_CURRENT';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES' where name='ACTS_WAITS_HISTORY_LONG';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
+Configuration PERFSCHEMA-ENABLED-BIGBANG-CYCLE
+==============================================
+
+Description
+-----------
+
+Server built with the performance schema.
+The performance schema is enabled at startup.
+All instruments are enabled and timed, in CYCLE.
+All possible consumers are enabled.
+
+Compiling options
+-----------------
+
+./configure --with-perfschema
+
+Server start options
+--------------------
+
+./mysqld --pse-enabled=true
+
+Configuration
+-------------
+
+UPDATE performance_schema.setup_instruments
+ set enabled='YES', timed='YES';
+
+UPDATE performance_schema.setup_timers
+ set timer_name='CYCLE';
+
+UPDATE performance_schema.setup_consumers
+ set enabled='YES';
+
+Pre-test queries
+----------------
+
+select version();
+show engine performance_schema status;
+select * from performance_schema.performance_timers;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+
+Post-test queries
+-----------------
+
+show engine performance_schema status;
+
| Thread |
|---|
| • bzr commit into mysql-6.0-perf branch (marc.alff:2743) | Marc Alff | 25 Nov |