#At file:///Users/malff/BZR_TREE/mysql-trunk-wl4813/ based on revid:marc.alff@stripped
3211 Marc Alff 2011-02-17
WL#4813 PERFORMANCE_SCHEMA Instrumenting Stages
WL#2515 PERFORMANCE_SCHEMA statements
Added more test cases.
added:
mysql-test/suite/perfschema/r/start_server_innodb.result
mysql-test/suite/perfschema/r/start_server_no_stage_class.result
mysql-test/suite/perfschema/r/start_server_no_stages_history.result
mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
mysql-test/suite/perfschema/r/start_server_no_statement_class.result
mysql-test/suite/perfschema/r/start_server_no_statements_history.result
mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
mysql-test/suite/perfschema/t/start_server_innodb-master.opt
mysql-test/suite/perfschema/t/start_server_innodb.test
mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt
mysql-test/suite/perfschema/t/start_server_no_stage_class.test
mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt
mysql-test/suite/perfschema/t/start_server_no_stages_history.test
mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt
mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test
mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt
mysql-test/suite/perfschema/t/start_server_no_statement_class.test
mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt
mysql-test/suite/perfschema/t/start_server_no_statements_history.test
mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt
mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test
modified:
storage/perfschema/pfs_events_stages.cc
storage/perfschema/pfs_events_statements.cc
=== added file 'mysql-test/suite/perfschema/r/start_server_innodb.result'
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,98 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show status like "performance_schema%";
+Variable_name Value
+Performance_schema_cond_classes_lost 0
+Performance_schema_cond_instances_lost 0
+Performance_schema_file_classes_lost 0
+Performance_schema_file_handles_lost 0
+Performance_schema_file_instances_lost 0
+Performance_schema_locker_lost 0
+Performance_schema_mutex_classes_lost 0
+Performance_schema_mutex_instances_lost 0
+Performance_schema_rwlock_classes_lost 0
+Performance_schema_rwlock_instances_lost 0
+Performance_schema_stage_classes_lost 0
+Performance_schema_statement_classes_lost 0
+Performance_schema_table_handles_lost 0
+Performance_schema_table_instances_lost 0
+Performance_schema_thread_classes_lost 0
+Performance_schema_thread_instances_lost 0
=== added file 'mysql-test/suite/perfschema/r/start_server_no_stage_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,106 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 0
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_stage_classes";
+Variable_name Value
+performance_schema_max_stage_classes 0
+select count(*) from performance_schema.setup_instruments
+where name like "stage/%";
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_STAGE_CLASSES_LOST';
+variable_value > 0
+1
+select count(*) from performance_schema.events_stages_current;
+count(*)
+0
+select count(*) from performance_schema.events_stages_history;
+count(*)
+0
+select count(*) from performance_schema.events_stages_history_long;
+count(*)
+0
+select count(*) from performance_schema.events_stages_summary_by_thread_by_event_name;
+count(*)
+0
+select count(*) from performance_schema.events_stages_summary_global_by_event_name;
+count(*)
+0
=== added file 'mysql-test/suite/perfschema/r/start_server_no_stages_history.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,87 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_stages_history_size";
+Variable_name Value
+performance_schema_events_stages_history_size 0
+select count(*) from performance_schema.events_stages_history;
+count(*)
+0
+truncate table performance_schema.events_stages_history;
=== added file 'mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,87 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_stages_history_long_size";
+Variable_name Value
+performance_schema_events_stages_history_long_size 0
+select count(*) from performance_schema.events_stages_history_long;
+count(*)
+0
+truncate table performance_schema.events_stages_history_long;
=== added file 'mysql-test/suite/perfschema/r/start_server_no_statement_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,106 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 0
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_max_statement_classes";
+Variable_name Value
+performance_schema_max_statement_classes 0
+select count(*) from performance_schema.setup_instruments
+where name like "statement/%";
+count(*)
+0
+select variable_value > 0 from information_schema.global_status
+where variable_name like 'PERFORMANCE_SCHEMA_STATEMENT_CLASSES_LOST';
+variable_value > 0
+1
+select count(*) from performance_schema.events_statements_current;
+count(*)
+0
+select count(*) from performance_schema.events_statements_history;
+count(*)
+0
+select count(*) from performance_schema.events_statements_history_long;
+count(*)
+0
+select count(*) from performance_schema.events_statements_summary_by_thread_by_event_name;
+count(*)
+0
+select count(*) from performance_schema.events_statements_summary_global_by_event_name;
+count(*)
+0
=== added file 'mysql-test/suite/perfschema/r/start_server_no_statements_history.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,87 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+performance_schema_events_statements_history_size 0
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_statements_history_size";
+Variable_name Value
+performance_schema_events_statements_history_size 0
+select count(*) from performance_schema.events_statements_history;
+count(*)
+0
+truncate table performance_schema.events_statements_history;
=== added file 'mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result 2011-02-17 18:10:56 +0000
@@ -0,0 +1,87 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+5
+select count(*) from performance_schema.setup_consumers;
+count(*)
+11
+select count(*) > 2 from performance_schema.setup_instruments;
+count(*) > 2
+1
+select count(*) from performance_schema.setup_timers;
+count(*)
+3
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+show variables like "performance_schema%";
+Variable_name Value
+performance_schema ON
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 10
+performance_schema_events_waits_history_long_size 10000
+performance_schema_events_waits_history_size 10
+performance_schema_max_cond_classes 80
+performance_schema_max_cond_instances 1000
+performance_schema_max_file_classes 50
+performance_schema_max_file_handles 32768
+performance_schema_max_file_instances 10000
+performance_schema_max_mutex_classes 200
+performance_schema_max_mutex_instances 10000
+performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_instances 10000
+performance_schema_max_stage_classes 100
+performance_schema_max_statement_classes 166
+performance_schema_max_table_handles 1000
+performance_schema_max_table_instances 500
+performance_schema_max_thread_classes 50
+performance_schema_max_thread_instances 1000
+performance_schema_setup_actors_size 100
+performance_schema_setup_objects_size 100
+show engine PERFORMANCE_SCHEMA status;
+show status like "performance_schema%";
+show variables like "performance_schema_events_statements_history_long_size";
+Variable_name Value
+performance_schema_events_statements_history_long_size 0
+select count(*) from performance_schema.events_statements_history_long;
+count(*)
+0
+truncate table performance_schema.events_statements_history_long;
=== added file 'mysql-test/suite/perfschema/t/start_server_innodb-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_innodb-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_innodb-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1 @@
+--loose-enable-performance-schema
=== added file 'mysql-test/suite/perfschema/t/start_server_innodb.test'
--- a/mysql-test/suite/perfschema/t/start_server_innodb.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_innodb.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,26 @@
+# Copyright (c) 2008, 2010, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_innodb.inc
+
+--source ../include/start_server_common.inc
+
+# Expecting nothing lost with default parameters
+
+show status like "performance_schema%";
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stage_class-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_stage_classes=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stage_class.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_stage_class.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stage_class.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,41 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no classes
+show variables like "performance_schema_max_stage_classes";
+
+select count(*) from performance_schema.setup_instruments
+ where name like "stage/%";
+
+# We lost all the classes
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_STAGE_CLASSES_LOST';
+
+# Expect no stages
+select count(*) from performance_schema.events_stages_current;
+select count(*) from performance_schema.events_stages_history;
+select count(*) from performance_schema.events_stages_history_long;
+
+# Expect no stages classes
+select count(*) from performance_schema.events_stages_summary_by_thread_by_event_name;
+select count(*) from performance_schema.events_stages_summary_global_by_event_name;
+
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_stages_history_size=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stages_history.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_stages_history.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,29 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history
+show variables like "performance_schema_events_stages_history_size";
+select count(*) from performance_schema.events_stages_history;
+
+# Valid operation, edge case
+truncate table performance_schema.events_stages_history;
+
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_stages_history_long_size=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,29 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history long
+show variables like "performance_schema_events_stages_history_long_size";
+select count(*) from performance_schema.events_stages_history_long;
+
+# Valid operation, edge case
+truncate table performance_schema.events_stages_history_long;
+
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statement_class-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_max_statement_classes=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statement_class.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_statement_class.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statement_class.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,41 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no classes
+show variables like "performance_schema_max_statement_classes";
+
+select count(*) from performance_schema.setup_instruments
+ where name like "statement/%";
+
+# We lost all the classes
+select variable_value > 0 from information_schema.global_status
+ where variable_name like 'PERFORMANCE_SCHEMA_STATEMENT_CLASSES_LOST';
+
+# Expect no statements
+select count(*) from performance_schema.events_statements_current;
+select count(*) from performance_schema.events_statements_history;
+select count(*) from performance_schema.events_statements_history_long;
+
+# Expect no statements classes
+select count(*) from performance_schema.events_statements_summary_by_thread_by_event_name;
+select count(*) from performance_schema.events_statements_summary_global_by_event_name;
+
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_statements_history_size=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statements_history.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_statements_history.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,29 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history
+show variables like "performance_schema_events_statements_history_size";
+select count(*) from performance_schema.events_statements_history;
+
+# Valid operation, edge case
+truncate table performance_schema.events_statements_history;
+
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt'
--- a/mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long-master.opt 2011-02-17 18:10:56 +0000
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance_schema_events_statements_history_long_size=0
=== added file 'mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test 2011-02-17 18:10:56 +0000
@@ -0,0 +1,29 @@
+# Copyright (c) 2008, 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--source ../include/start_server_common.inc
+
+# Expect no history long
+show variables like "performance_schema_events_statements_history_long_size";
+select count(*) from performance_schema.events_statements_history_long;
+
+# Valid operation, edge case
+truncate table performance_schema.events_statements_history_long;
+
=== modified file 'storage/perfschema/pfs_events_stages.cc'
--- a/storage/perfschema/pfs_events_stages.cc 2011-02-14 14:23:55 +0000
+++ b/storage/perfschema/pfs_events_stages.cc 2011-02-17 18:10:56 +0000
@@ -82,6 +82,11 @@ static inline void copy_events_stages(PF
*/
void insert_events_stages_history(PFS_thread *thread, PFS_events_stages *stage)
{
+ if (unlikely(events_stages_history_per_thread == 0))
+ return;
+
+ DBUG_ASSERT(thread->m_stages_history != NULL);
+
uint index= thread->m_stages_history_index;
/*
@@ -109,6 +114,11 @@ void insert_events_stages_history(PFS_th
*/
void insert_events_stages_history_long(PFS_events_stages *stage)
{
+ if (unlikely(events_stages_history_long_size == 0))
+ return;
+
+ DBUG_ASSERT(events_stages_history_long_array != NULL);
+
uint index= PFS_atomic::add_u32(&events_stages_history_long_index, 1);
index= index % events_stages_history_long_size;
=== modified file 'storage/perfschema/pfs_events_statements.cc'
--- a/storage/perfschema/pfs_events_statements.cc 2011-02-14 14:23:55 +0000
+++ b/storage/perfschema/pfs_events_statements.cc 2011-02-17 18:10:56 +0000
@@ -82,6 +82,11 @@ static inline void copy_events_statement
*/
void insert_events_statements_history(PFS_thread *thread, PFS_events_statements *statement)
{
+ if (unlikely(events_statements_history_per_thread == 0))
+ return;
+
+ DBUG_ASSERT(thread->m_statements_history != NULL);
+
uint index= thread->m_statements_history_index;
/*
@@ -109,6 +114,11 @@ void insert_events_statements_history(PF
*/
void insert_events_statements_history_long(PFS_events_statements *statement)
{
+ if (unlikely(events_statements_history_long_size == 0))
+ return ;
+
+ DBUG_ASSERT(events_statements_history_long_array != NULL);
+
uint index= PFS_atomic::add_u32(&events_statements_history_long_index, 1);
index= index % events_statements_history_long_size;
Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20110217181056-3f6dmth5ftto32oo.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (marc.alff:3211) WL#2515 WL#4813 | Marc Alff | 17 Feb |