Browse Source
MDEV-12121 Introduce build option WITH_INNODB_AHI to disable innodb_adaptive_hash_index
MDEV-12121 Introduce build option WITH_INNODB_AHI to disable innodb_adaptive_hash_index
The InnoDB adaptive hash index is sometimes degrading the performance of InnoDB, and it is sometimes disabled to get more consistent performance. We should have a compile-time option to disable the adaptive hash index. Let us introduce two options: OPTION(WITH_INNODB_AHI "Include innodb_adaptive_hash_index" ON) OPTION(WITH_INNODB_ROOT_GUESS "Cache index root block descriptors" ON) where WITH_INNODB_AHI always implies WITH_INNODB_ROOT_GUESS. As part of this change, the misleadingly named function trx_search_latch_release_if_reserved(trx) will be replaced with the macro trx_assert_no_search_latch(trx) that will be empty unless BTR_CUR_HASH_ADAPT is defined (cmake -DWITH_INNODB_AHI=ON). We will also remove the unused column INFORMATION_SCHEMA.INNODB_TRX.TRX_ADAPTIVE_HASH_TIMEOUT. In MariaDB Server 10.1, it used to reflect the value of trx_t::search_latch_timeout which could be adjusted during row_search_for_mysql(). In 10.2, there is no such field. Other than the removal of the unused column TRX_ADAPTIVE_HASH_TIMEOUT, this is an almost non-functional change to the server when using the default build options. Some tests are adjusted so that they will work with both -DWITH_INNODB_AHI=ON and -DWITH_INNODB_AHI=OFF. The test innodb.innodb_monitor has been renamed to innodb.monitor in order to track MySQL 5.7, and the duplicate tests sys_vars.innodb_monitor_* are removed.pull/339/head
61 changed files with 659 additions and 4459 deletions
-
4mysql-test/include/have_innodb_ahi.inc
-
2mysql-test/suite/innodb/r/innodb_information_schema.result
-
619mysql-test/suite/innodb/r/innodb_monitor.result
-
26mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
-
63mysql-test/suite/innodb/r/monitor.result
-
14mysql-test/suite/innodb/t/innodb_information_schema.test
-
387mysql-test/suite/innodb/t/innodb_monitor.test
-
9mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test
-
71mysql-test/suite/innodb/t/monitor.test
-
616mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
-
616mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
-
616mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
-
9mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
-
30mysql-test/suite/sys_vars/r/sysvars_innodb.result
-
1mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test
-
1mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_parts_basic.test
-
378mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
-
378mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test
-
378mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
-
2mysql-test/suite/sys_vars/t/sysvars_innodb.test
-
46storage/innobase/btr/btr0cur.cc
-
39storage/innobase/btr/btr0sea.cc
-
34storage/innobase/buf/buf0buf.cc
-
52storage/innobase/buf/buf0lru.cc
-
19storage/innobase/dict/dict0dict.cc
-
34storage/innobase/fsp/fsp0fsp.cc
-
3storage/innobase/gis/gis0sea.cc
-
4storage/innobase/ha/ha0ha.cc
-
6storage/innobase/ha/hash0hash.cc
-
99storage/innobase/handler/ha_innodb.cc
-
6storage/innobase/handler/ha_innopart.cc
-
5storage/innobase/handler/handler0alter.cc
-
103storage/innobase/handler/i_s.cc
-
4storage/innobase/ibuf/ibuf0ibuf.cc
-
11storage/innobase/include/btr0cur.h
-
66storage/innobase/include/btr0sea.h
-
31storage/innobase/include/btr0sea.ic
-
2storage/innobase/include/btr0types.h
-
16storage/innobase/include/buf0buf.h
-
4storage/innobase/include/dict0mem.h
-
7storage/innobase/include/dict0mem.ic
-
34storage/innobase/include/fsp0fsp.h
-
4storage/innobase/include/ha0ha.h
-
18storage/innobase/include/ha0ha.ic
-
6storage/innobase/include/hash0hash.h
-
4storage/innobase/include/page0cur.h
-
4storage/innobase/include/srv0mon.h
-
2storage/innobase/include/sync0types.h
-
2storage/innobase/include/trx0i_s.h
-
20storage/innobase/include/trx0trx.h
-
10storage/innobase/include/trx0trx.ic
-
30storage/innobase/innodb.cmake
-
22storage/innobase/page/page0cur.cc
-
93storage/innobase/row/row0sel.cc
-
22storage/innobase/srv/srv0conc.cc
-
8storage/innobase/srv/srv0mon.cc
-
9storage/innobase/srv/srv0srv.cc
-
6storage/innobase/srv/srv0start.cc
-
2storage/innobase/trx/trx0i_s.cc
-
7storage/innobase/trx/trx0trx.cc
-
4storage/innobase/ut/ut0new.cc
@ -0,0 +1,4 @@ |
|||
if (`select count(*)!=1 from information_schema.GLOBAL_VARIABLES |
|||
where variable_name='innodb_adaptive_hash_index'`){ |
|||
skip Test requires cmake -DWITH_INNODB_AHI=ON; |
|||
} |
|||
@ -1,619 +0,0 @@ |
|||
set global innodb_monitor_disable = All; |
|||
select name, status from information_schema.innodb_metrics; |
|||
name status |
|||
metadata_table_handles_opened disabled |
|||
metadata_table_handles_closed disabled |
|||
metadata_table_reference_count disabled |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
buffer_pool_size disabled |
|||
buffer_pool_reads disabled |
|||
buffer_pool_read_requests disabled |
|||
buffer_pool_write_requests disabled |
|||
buffer_pool_wait_free disabled |
|||
buffer_pool_read_ahead disabled |
|||
buffer_pool_read_ahead_evicted disabled |
|||
buffer_pool_pages_total disabled |
|||
buffer_pool_pages_misc disabled |
|||
buffer_pool_pages_data disabled |
|||
buffer_pool_bytes_data disabled |
|||
buffer_pool_pages_dirty disabled |
|||
buffer_pool_bytes_dirty disabled |
|||
buffer_pool_pages_free disabled |
|||
buffer_pages_created disabled |
|||
buffer_pages_written disabled |
|||
buffer_index_pages_written disabled |
|||
buffer_non_index_pages_written disabled |
|||
buffer_pages_read disabled |
|||
buffer_pages0_read disabled |
|||
buffer_index_sec_rec_cluster_reads disabled |
|||
buffer_index_sec_rec_cluster_reads_avoided disabled |
|||
buffer_data_reads disabled |
|||
buffer_data_written disabled |
|||
buffer_flush_batch_scanned disabled |
|||
buffer_flush_batch_num_scan disabled |
|||
buffer_flush_batch_scanned_per_call disabled |
|||
buffer_flush_batch_total_pages disabled |
|||
buffer_flush_batches disabled |
|||
buffer_flush_batch_pages disabled |
|||
buffer_flush_neighbor_total_pages disabled |
|||
buffer_flush_neighbor disabled |
|||
buffer_flush_neighbor_pages disabled |
|||
buffer_flush_n_to_flush_requested disabled |
|||
buffer_flush_n_to_flush_by_age disabled |
|||
buffer_flush_adaptive_avg_time_slot disabled |
|||
buffer_LRU_batch_flush_avg_time_slot disabled |
|||
buffer_flush_adaptive_avg_time_thread disabled |
|||
buffer_LRU_batch_flush_avg_time_thread disabled |
|||
buffer_flush_adaptive_avg_time_est disabled |
|||
buffer_LRU_batch_flush_avg_time_est disabled |
|||
buffer_flush_avg_time disabled |
|||
buffer_flush_adaptive_avg_pass disabled |
|||
buffer_LRU_batch_flush_avg_pass disabled |
|||
buffer_flush_avg_pass disabled |
|||
buffer_LRU_get_free_loops disabled |
|||
buffer_LRU_get_free_waits disabled |
|||
buffer_flush_avg_page_rate disabled |
|||
buffer_flush_lsn_avg_rate disabled |
|||
buffer_flush_pct_for_dirty disabled |
|||
buffer_flush_pct_for_lsn disabled |
|||
buffer_flush_sync_waits disabled |
|||
buffer_flush_adaptive_total_pages disabled |
|||
buffer_flush_adaptive disabled |
|||
buffer_flush_adaptive_pages disabled |
|||
buffer_flush_sync_total_pages disabled |
|||
buffer_flush_sync disabled |
|||
buffer_flush_sync_pages disabled |
|||
buffer_flush_background_total_pages disabled |
|||
buffer_flush_background disabled |
|||
buffer_flush_background_pages disabled |
|||
buffer_LRU_batch_scanned disabled |
|||
buffer_LRU_batch_num_scan disabled |
|||
buffer_LRU_batch_scanned_per_call disabled |
|||
buffer_LRU_batch_flush_total_pages disabled |
|||
buffer_LRU_batches_flush disabled |
|||
buffer_LRU_batch_flush_pages disabled |
|||
buffer_LRU_batch_evict_total_pages disabled |
|||
buffer_LRU_batches_evict disabled |
|||
buffer_LRU_batch_evict_pages disabled |
|||
buffer_LRU_single_flush_scanned disabled |
|||
buffer_LRU_single_flush_num_scan disabled |
|||
buffer_LRU_single_flush_scanned_per_call disabled |
|||
buffer_LRU_single_flush_failure_count disabled |
|||
buffer_LRU_get_free_search disabled |
|||
buffer_LRU_search_scanned disabled |
|||
buffer_LRU_search_num_scan disabled |
|||
buffer_LRU_search_scanned_per_call disabled |
|||
buffer_LRU_unzip_search_scanned disabled |
|||
buffer_LRU_unzip_search_num_scan disabled |
|||
buffer_LRU_unzip_search_scanned_per_call disabled |
|||
buffer_page_read_index_leaf disabled |
|||
buffer_page_read_index_non_leaf disabled |
|||
buffer_page_read_index_ibuf_leaf disabled |
|||
buffer_page_read_index_ibuf_non_leaf disabled |
|||
buffer_page_read_undo_log disabled |
|||
buffer_page_read_index_inode disabled |
|||
buffer_page_read_ibuf_free_list disabled |
|||
buffer_page_read_ibuf_bitmap disabled |
|||
buffer_page_read_system_page disabled |
|||
buffer_page_read_trx_system disabled |
|||
buffer_page_read_fsp_hdr disabled |
|||
buffer_page_read_xdes disabled |
|||
buffer_page_read_blob disabled |
|||
buffer_page_read_zblob disabled |
|||
buffer_page_read_zblob2 disabled |
|||
buffer_page_read_other disabled |
|||
buffer_page_written_index_leaf disabled |
|||
buffer_page_written_index_non_leaf disabled |
|||
buffer_page_written_index_ibuf_leaf disabled |
|||
buffer_page_written_index_ibuf_non_leaf disabled |
|||
buffer_page_written_undo_log disabled |
|||
buffer_page_written_index_inode disabled |
|||
buffer_page_written_ibuf_free_list disabled |
|||
buffer_page_written_ibuf_bitmap disabled |
|||
buffer_page_written_system_page disabled |
|||
buffer_page_written_trx_system disabled |
|||
buffer_page_written_fsp_hdr disabled |
|||
buffer_page_written_xdes disabled |
|||
buffer_page_written_blob disabled |
|||
buffer_page_written_zblob disabled |
|||
buffer_page_written_zblob2 disabled |
|||
buffer_page_written_other disabled |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs disabled |
|||
os_pending_reads disabled |
|||
os_pending_writes disabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs disabled |
|||
os_log_pending_writes disabled |
|||
trx_rw_commits disabled |
|||
trx_ro_commits disabled |
|||
trx_nl_ro_commits disabled |
|||
trx_commits_insert_update disabled |
|||
trx_rollbacks disabled |
|||
trx_rollbacks_savepoint disabled |
|||
trx_rollback_active disabled |
|||
trx_active_transactions disabled |
|||
trx_rseg_history_len disabled |
|||
trx_undo_slots_used disabled |
|||
trx_undo_slots_cached disabled |
|||
trx_rseg_current_size disabled |
|||
purge_del_mark_records disabled |
|||
purge_upd_exist_or_extern_records disabled |
|||
purge_invoked disabled |
|||
purge_undo_log_pages disabled |
|||
purge_dml_delay_usec disabled |
|||
purge_stop_count disabled |
|||
purge_resume_count disabled |
|||
log_checkpoints disabled |
|||
log_lsn_last_flush disabled |
|||
log_lsn_last_checkpoint disabled |
|||
log_lsn_current disabled |
|||
log_lsn_checkpoint_age disabled |
|||
log_lsn_buf_pool_oldest disabled |
|||
log_max_modified_age_async disabled |
|||
log_max_modified_age_sync disabled |
|||
log_pending_log_flushes disabled |
|||
log_pending_checkpoint_writes disabled |
|||
log_num_log_io disabled |
|||
log_waits disabled |
|||
log_write_requests disabled |
|||
log_writes disabled |
|||
log_padded disabled |
|||
compress_pages_compressed disabled |
|||
compress_pages_decompressed disabled |
|||
compression_pad_increments disabled |
|||
compression_pad_decrements disabled |
|||
compress_saved disabled |
|||
compress_pages_page_compressed disabled |
|||
compress_page_compressed_trim_op disabled |
|||
compress_pages_page_decompressed disabled |
|||
compress_pages_page_compression_error disabled |
|||
compress_pages_encrypted disabled |
|||
compress_pages_decrypted disabled |
|||
index_page_splits disabled |
|||
index_page_merge_attempts disabled |
|||
index_page_merge_successful disabled |
|||
index_page_reorg_attempts disabled |
|||
index_page_reorg_successful disabled |
|||
index_page_discards disabled |
|||
adaptive_hash_searches disabled |
|||
adaptive_hash_searches_btree disabled |
|||
adaptive_hash_pages_added disabled |
|||
adaptive_hash_pages_removed disabled |
|||
adaptive_hash_rows_added disabled |
|||
adaptive_hash_rows_removed disabled |
|||
adaptive_hash_rows_deleted_no_hash_entry disabled |
|||
adaptive_hash_rows_updated disabled |
|||
file_num_open_files disabled |
|||
ibuf_merges_insert disabled |
|||
ibuf_merges_delete_mark disabled |
|||
ibuf_merges_delete disabled |
|||
ibuf_merges_discard_insert disabled |
|||
ibuf_merges_discard_delete_mark disabled |
|||
ibuf_merges_discard_delete disabled |
|||
ibuf_merges disabled |
|||
ibuf_size disabled |
|||
innodb_master_thread_sleeps disabled |
|||
innodb_activity_count disabled |
|||
innodb_master_active_loops disabled |
|||
innodb_master_idle_loops disabled |
|||
innodb_background_drop_table_usec disabled |
|||
innodb_ibuf_merge_usec disabled |
|||
innodb_log_flush_usec disabled |
|||
innodb_mem_validate_usec disabled |
|||
innodb_master_purge_usec disabled |
|||
innodb_dict_lru_usec disabled |
|||
innodb_dict_lru_count_active disabled |
|||
innodb_dict_lru_count_idle disabled |
|||
innodb_checkpoint_usec disabled |
|||
innodb_dblwr_writes disabled |
|||
innodb_dblwr_pages_written disabled |
|||
innodb_page_size disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
dml_reads disabled |
|||
dml_inserts disabled |
|||
dml_deletes disabled |
|||
dml_updates disabled |
|||
dml_system_reads disabled |
|||
dml_system_inserts disabled |
|||
dml_system_deletes disabled |
|||
dml_system_updates disabled |
|||
ddl_background_drop_indexes disabled |
|||
ddl_background_drop_tables disabled |
|||
ddl_online_create_index disabled |
|||
ddl_pending_alter_table disabled |
|||
ddl_sort_file_alter_table disabled |
|||
ddl_log_file_alter_table disabled |
|||
icp_attempts disabled |
|||
icp_no_match disabled |
|||
icp_out_of_range disabled |
|||
icp_match disabled |
|||
set global innodb_monitor_enable = all; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_enable = aaa; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa' |
|||
set global innodb_monitor_disable = All; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_reset_all = all; |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
name |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
name status |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*' |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%_%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
name status |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs enabled |
|||
os_pending_reads enabled |
|||
os_pending_writes enabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs enabled |
|||
os_log_pending_writes enabled |
|||
set global innodb_monitor_enable=""; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '' |
|||
set global innodb_monitor_enable="_"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_' |
|||
set global innodb_monitor_disable = module_metadata; |
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
create index idx on monitor_test(col); |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_metadata; |
|||
set global innodb_monitor_reset = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = module_trx; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled |
|||
trx_active_transactions 1 0 0 1 0 0 enabled |
|||
set global innodb_monitor_disable = module_trx; |
|||
set global innodb_monitor_enable = module_dml; |
|||
insert into monitor_test values(9); |
|||
update monitor_test set col = 10 where col = 9; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 4 NULL 4 4 NULL 4 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 6 NULL 6 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 2 NULL 2 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 0 NULL 0 enabled |
|||
dml_inserts 1 NULL 1 0 NULL 0 enabled |
|||
dml_deletes 2 NULL 2 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 disabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 disabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 disabled |
|||
dml_updates 2 NULL 2 0 NULL 0 disabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts 2 NULL 2 2 NULL 2 enabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
drop table monitor_test; |
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
file_num_open_files # # # # # # enabled |
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
set global innodb_monitor_enable = "icp%"; |
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
insert into monitor_test values("13", 2, "aa"); |
|||
select a from monitor_test where b < 1 for update; |
|||
a |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 1 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 0 |
|||
select a from monitor_test where b < 3 for update; |
|||
a |
|||
13 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 2 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 1 |
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = all; |
|||
set global innodb_monitor_reset_all = all; |
|||
select 1 from `information_schema`.`INNODB_METRICS` |
|||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end; |
|||
1 |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
@ -1,387 +0,0 @@ |
|||
# This is the test for Metrics Monitor Table feature. |
|||
# Test the metrics monitor system's control system |
|||
# and counter accuracy. |
|||
|
|||
--source include/have_innodb.inc |
|||
|
|||
set global innodb_monitor_disable = All; |
|||
|
|||
# Test turn on/off the monitor counter with "all" option |
|||
# By default, they will be off |
|||
select name, status from information_schema.innodb_metrics; |
|||
|
|||
# Turn on all monitor counters |
|||
set global innodb_monitor_enable = all; |
|||
|
|||
# status should all change to "enabled" |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Test wrong argument to the global configure option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = aaa; |
|||
|
|||
# We require a valid monitor counter/module name. There is no default |
|||
# counter name or module. A warning will be printed asking user to |
|||
# specify a valid counter name. |
|||
#--disable_warnings |
|||
#set global innodb_monitor_enable = default; |
|||
#--enable_warnings |
|||
|
|||
# Turn off all monitor counters, option name should be case |
|||
# insensitive |
|||
set global innodb_monitor_disable = All; |
|||
|
|||
# status should all change to "disabled" |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
# count should all change to 0 |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
|
|||
# Test wildcard match, turn on all counters contain string "lock" |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
|
|||
# All lock related counter should be enabled |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
|
|||
# Disable them |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
|
|||
# All lock related counter should be disabled |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
|
|||
# No match for "%lock*" |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
|
|||
# All counters will be turned on with wildcard match string with all "%" |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all counters |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# One more round testing. All counters will be turned on with |
|||
# single wildcard character "%" |
|||
set global innodb_monitor_enable="%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all the counters with "%_%" |
|||
set global innodb_monitor_disable="%_%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Turn on all counters start with "log" |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
|
|||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_" |
|||
# is single character wildcard match word |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
|
|||
# Turn on counters whose name contains "os" and "pending" with |
|||
# wildcard match "os%pending%" |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
|
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
|
|||
# Empty string is an invalid option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable=""; |
|||
|
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable="_"; |
|||
|
|||
# Reset counters only in "module_metadata" module |
|||
set global innodb_monitor_disable = module_metadata; |
|||
|
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
# Only turn on "table_open" counter |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# This will open the monitor_test table |
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment by 1 |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset the counter value while counter is still on (started) |
|||
# This will reset value "count_reset" but not |
|||
# "count" |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again to increment "metadata_table_handles_opened" again |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Cannot reset all monitor value while the counter is on |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn off the counter "metadata_table_handles_opened" |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
|
|||
# Reset the counter value while counter is off (disabled) |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again. Since monitor is off, "metadata_table_handles_opened" |
|||
# should not be incremented |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select * from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset all the counters, include those counter *_since_start |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn on "table_open" counter again |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Test metadata_table_handles_opened again to see if it is working correctly |
|||
# after above round of turning on/off/reset |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Test counter "metadata_table_handles_closed", |
|||
# create index will close the old handle |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
|
|||
create index idx on monitor_test(col); |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Reset counters only in "module_metadata" module |
|||
set global innodb_monitor_disable = module_metadata; |
|||
|
|||
set global innodb_monitor_reset = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Test Transaction Module |
|||
set global innodb_monitor_enable = module_trx; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
|
|||
set global innodb_monitor_disable = module_trx; |
|||
|
|||
# Test DML Module |
|||
set global innodb_monitor_enable = module_dml; |
|||
|
|||
insert into monitor_test values(9); |
|||
|
|||
update monitor_test set col = 10 where col = 9; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# test reset counter while the counter is on |
|||
set global innodb_monitor_reset = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# insert/delete some rows after the reset |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# We do not allow reset_all while the counter is on, nothing |
|||
# should be reset here |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Turn off the counter |
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Open individual counter "dml_inserts" |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
|
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
# Only counter "dml_inserts" should be updated |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
drop table monitor_test; |
|||
|
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
|
|||
# Counters are unpredictable when innodb-file-per-table is on |
|||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
|
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
|
|||
# Test ICP module counters |
|||
set global innodb_monitor_enable = "icp%"; |
|||
|
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
|
|||
insert into monitor_test values("13", 2, "aa"); |
|||
|
|||
select a from monitor_test where b < 1 for update; |
|||
|
|||
# should have icp_attempts = 1 and icp_out_of_range = 1 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
# should have icp_attempts = 2 and icp_match = 1 |
|||
select a from monitor_test where b < 3 for update; |
|||
|
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
drop table monitor_test; |
|||
|
|||
set global innodb_monitor_disable = all; |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
# Test for bug #13966091 |
|||
select 1 from `information_schema`.`INNODB_METRICS` |
|||
where case (1) when (1) then (AVG_COUNT_RESET) else (1) end; |
|||
|
|||
-- disable_warnings |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
-- enable_warnings |
|||
@ -1,616 +0,0 @@ |
|||
set global innodb_monitor_disable = All; |
|||
select name, status from information_schema.innodb_metrics; |
|||
name status |
|||
metadata_table_handles_opened disabled |
|||
metadata_table_handles_closed disabled |
|||
metadata_table_reference_count disabled |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
buffer_pool_size disabled |
|||
buffer_pool_reads disabled |
|||
buffer_pool_read_requests disabled |
|||
buffer_pool_write_requests disabled |
|||
buffer_pool_wait_free disabled |
|||
buffer_pool_read_ahead disabled |
|||
buffer_pool_read_ahead_evicted disabled |
|||
buffer_pool_pages_total disabled |
|||
buffer_pool_pages_misc disabled |
|||
buffer_pool_pages_data disabled |
|||
buffer_pool_bytes_data disabled |
|||
buffer_pool_pages_dirty disabled |
|||
buffer_pool_bytes_dirty disabled |
|||
buffer_pool_pages_free disabled |
|||
buffer_pages_created disabled |
|||
buffer_pages_written disabled |
|||
buffer_index_pages_written disabled |
|||
buffer_non_index_pages_written disabled |
|||
buffer_pages_read disabled |
|||
buffer_pages0_read disabled |
|||
buffer_index_sec_rec_cluster_reads disabled |
|||
buffer_index_sec_rec_cluster_reads_avoided disabled |
|||
buffer_data_reads disabled |
|||
buffer_data_written disabled |
|||
buffer_flush_batch_scanned disabled |
|||
buffer_flush_batch_num_scan disabled |
|||
buffer_flush_batch_scanned_per_call disabled |
|||
buffer_flush_batch_total_pages disabled |
|||
buffer_flush_batches disabled |
|||
buffer_flush_batch_pages disabled |
|||
buffer_flush_neighbor_total_pages disabled |
|||
buffer_flush_neighbor disabled |
|||
buffer_flush_neighbor_pages disabled |
|||
buffer_flush_n_to_flush_requested disabled |
|||
buffer_flush_n_to_flush_by_age disabled |
|||
buffer_flush_adaptive_avg_time_slot disabled |
|||
buffer_LRU_batch_flush_avg_time_slot disabled |
|||
buffer_flush_adaptive_avg_time_thread disabled |
|||
buffer_LRU_batch_flush_avg_time_thread disabled |
|||
buffer_flush_adaptive_avg_time_est disabled |
|||
buffer_LRU_batch_flush_avg_time_est disabled |
|||
buffer_flush_avg_time disabled |
|||
buffer_flush_adaptive_avg_pass disabled |
|||
buffer_LRU_batch_flush_avg_pass disabled |
|||
buffer_flush_avg_pass disabled |
|||
buffer_LRU_get_free_loops disabled |
|||
buffer_LRU_get_free_waits disabled |
|||
buffer_flush_avg_page_rate disabled |
|||
buffer_flush_lsn_avg_rate disabled |
|||
buffer_flush_pct_for_dirty disabled |
|||
buffer_flush_pct_for_lsn disabled |
|||
buffer_flush_sync_waits disabled |
|||
buffer_flush_adaptive_total_pages disabled |
|||
buffer_flush_adaptive disabled |
|||
buffer_flush_adaptive_pages disabled |
|||
buffer_flush_sync_total_pages disabled |
|||
buffer_flush_sync disabled |
|||
buffer_flush_sync_pages disabled |
|||
buffer_flush_background_total_pages disabled |
|||
buffer_flush_background disabled |
|||
buffer_flush_background_pages disabled |
|||
buffer_LRU_batch_scanned disabled |
|||
buffer_LRU_batch_num_scan disabled |
|||
buffer_LRU_batch_scanned_per_call disabled |
|||
buffer_LRU_batch_flush_total_pages disabled |
|||
buffer_LRU_batches_flush disabled |
|||
buffer_LRU_batch_flush_pages disabled |
|||
buffer_LRU_batch_evict_total_pages disabled |
|||
buffer_LRU_batches_evict disabled |
|||
buffer_LRU_batch_evict_pages disabled |
|||
buffer_LRU_single_flush_scanned disabled |
|||
buffer_LRU_single_flush_num_scan disabled |
|||
buffer_LRU_single_flush_scanned_per_call disabled |
|||
buffer_LRU_single_flush_failure_count disabled |
|||
buffer_LRU_get_free_search disabled |
|||
buffer_LRU_search_scanned disabled |
|||
buffer_LRU_search_num_scan disabled |
|||
buffer_LRU_search_scanned_per_call disabled |
|||
buffer_LRU_unzip_search_scanned disabled |
|||
buffer_LRU_unzip_search_num_scan disabled |
|||
buffer_LRU_unzip_search_scanned_per_call disabled |
|||
buffer_page_read_index_leaf disabled |
|||
buffer_page_read_index_non_leaf disabled |
|||
buffer_page_read_index_ibuf_leaf disabled |
|||
buffer_page_read_index_ibuf_non_leaf disabled |
|||
buffer_page_read_undo_log disabled |
|||
buffer_page_read_index_inode disabled |
|||
buffer_page_read_ibuf_free_list disabled |
|||
buffer_page_read_ibuf_bitmap disabled |
|||
buffer_page_read_system_page disabled |
|||
buffer_page_read_trx_system disabled |
|||
buffer_page_read_fsp_hdr disabled |
|||
buffer_page_read_xdes disabled |
|||
buffer_page_read_blob disabled |
|||
buffer_page_read_zblob disabled |
|||
buffer_page_read_zblob2 disabled |
|||
buffer_page_read_other disabled |
|||
buffer_page_written_index_leaf disabled |
|||
buffer_page_written_index_non_leaf disabled |
|||
buffer_page_written_index_ibuf_leaf disabled |
|||
buffer_page_written_index_ibuf_non_leaf disabled |
|||
buffer_page_written_undo_log disabled |
|||
buffer_page_written_index_inode disabled |
|||
buffer_page_written_ibuf_free_list disabled |
|||
buffer_page_written_ibuf_bitmap disabled |
|||
buffer_page_written_system_page disabled |
|||
buffer_page_written_trx_system disabled |
|||
buffer_page_written_fsp_hdr disabled |
|||
buffer_page_written_xdes disabled |
|||
buffer_page_written_blob disabled |
|||
buffer_page_written_zblob disabled |
|||
buffer_page_written_zblob2 disabled |
|||
buffer_page_written_other disabled |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs disabled |
|||
os_pending_reads disabled |
|||
os_pending_writes disabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs disabled |
|||
os_log_pending_writes disabled |
|||
trx_rw_commits disabled |
|||
trx_ro_commits disabled |
|||
trx_nl_ro_commits disabled |
|||
trx_commits_insert_update disabled |
|||
trx_rollbacks disabled |
|||
trx_rollbacks_savepoint disabled |
|||
trx_rollback_active disabled |
|||
trx_active_transactions disabled |
|||
trx_rseg_history_len disabled |
|||
trx_undo_slots_used disabled |
|||
trx_undo_slots_cached disabled |
|||
trx_rseg_current_size disabled |
|||
purge_del_mark_records disabled |
|||
purge_upd_exist_or_extern_records disabled |
|||
purge_invoked disabled |
|||
purge_undo_log_pages disabled |
|||
purge_dml_delay_usec disabled |
|||
purge_stop_count disabled |
|||
purge_resume_count disabled |
|||
log_checkpoints disabled |
|||
log_lsn_last_flush disabled |
|||
log_lsn_last_checkpoint disabled |
|||
log_lsn_current disabled |
|||
log_lsn_checkpoint_age disabled |
|||
log_lsn_buf_pool_oldest disabled |
|||
log_max_modified_age_async disabled |
|||
log_max_modified_age_sync disabled |
|||
log_pending_log_flushes disabled |
|||
log_pending_checkpoint_writes disabled |
|||
log_num_log_io disabled |
|||
log_waits disabled |
|||
log_write_requests disabled |
|||
log_writes disabled |
|||
log_padded disabled |
|||
compress_pages_compressed disabled |
|||
compress_pages_decompressed disabled |
|||
compression_pad_increments disabled |
|||
compression_pad_decrements disabled |
|||
compress_saved disabled |
|||
compress_pages_page_compressed disabled |
|||
compress_page_compressed_trim_op disabled |
|||
compress_pages_page_decompressed disabled |
|||
compress_pages_page_compression_error disabled |
|||
compress_pages_encrypted disabled |
|||
compress_pages_decrypted disabled |
|||
index_page_splits disabled |
|||
index_page_merge_attempts disabled |
|||
index_page_merge_successful disabled |
|||
index_page_reorg_attempts disabled |
|||
index_page_reorg_successful disabled |
|||
index_page_discards disabled |
|||
adaptive_hash_searches disabled |
|||
adaptive_hash_searches_btree disabled |
|||
adaptive_hash_pages_added disabled |
|||
adaptive_hash_pages_removed disabled |
|||
adaptive_hash_rows_added disabled |
|||
adaptive_hash_rows_removed disabled |
|||
adaptive_hash_rows_deleted_no_hash_entry disabled |
|||
adaptive_hash_rows_updated disabled |
|||
file_num_open_files disabled |
|||
ibuf_merges_insert disabled |
|||
ibuf_merges_delete_mark disabled |
|||
ibuf_merges_delete disabled |
|||
ibuf_merges_discard_insert disabled |
|||
ibuf_merges_discard_delete_mark disabled |
|||
ibuf_merges_discard_delete disabled |
|||
ibuf_merges disabled |
|||
ibuf_size disabled |
|||
innodb_master_thread_sleeps disabled |
|||
innodb_activity_count disabled |
|||
innodb_master_active_loops disabled |
|||
innodb_master_idle_loops disabled |
|||
innodb_background_drop_table_usec disabled |
|||
innodb_ibuf_merge_usec disabled |
|||
innodb_log_flush_usec disabled |
|||
innodb_mem_validate_usec disabled |
|||
innodb_master_purge_usec disabled |
|||
innodb_dict_lru_usec disabled |
|||
innodb_dict_lru_count_active disabled |
|||
innodb_dict_lru_count_idle disabled |
|||
innodb_checkpoint_usec disabled |
|||
innodb_dblwr_writes disabled |
|||
innodb_dblwr_pages_written disabled |
|||
innodb_page_size disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
dml_reads disabled |
|||
dml_inserts disabled |
|||
dml_deletes disabled |
|||
dml_updates disabled |
|||
dml_system_reads disabled |
|||
dml_system_inserts disabled |
|||
dml_system_deletes disabled |
|||
dml_system_updates disabled |
|||
ddl_background_drop_indexes disabled |
|||
ddl_background_drop_tables disabled |
|||
ddl_online_create_index disabled |
|||
ddl_pending_alter_table disabled |
|||
ddl_sort_file_alter_table disabled |
|||
ddl_log_file_alter_table disabled |
|||
icp_attempts disabled |
|||
icp_no_match disabled |
|||
icp_out_of_range disabled |
|||
icp_match disabled |
|||
set global innodb_monitor_enable = all; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_enable = aaa; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa' |
|||
set global innodb_monitor_disable = All; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_reset_all = all; |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
name |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
name status |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*' |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%_%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
name status |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs enabled |
|||
os_pending_reads enabled |
|||
os_pending_writes enabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs enabled |
|||
os_log_pending_writes enabled |
|||
set global innodb_monitor_enable=""; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '' |
|||
set global innodb_monitor_enable="_"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_' |
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
create index idx on monitor_test(col); |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_metadata; |
|||
set global innodb_monitor_reset = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = module_trx; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled |
|||
trx_active_transactions 1 0 0 1 0 0 enabled |
|||
set global innodb_monitor_disable = module_trx; |
|||
set global innodb_monitor_enable = module_dml; |
|||
insert into monitor_test values(9); |
|||
update monitor_test set col = 10 where col = 9; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 4 NULL 4 4 NULL 4 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 6 NULL 6 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 2 NULL 2 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 0 NULL 0 enabled |
|||
dml_inserts 1 NULL 1 0 NULL 0 enabled |
|||
dml_deletes 2 NULL 2 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 disabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 disabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 disabled |
|||
dml_updates 2 NULL 2 0 NULL 0 disabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts 2 NULL 2 2 NULL 2 enabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
drop table monitor_test; |
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
file_num_open_files # # # # # # enabled |
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
set global innodb_monitor_enable = "icp%"; |
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
insert into monitor_test values("13", 2, "aa"); |
|||
select a from monitor_test where b < 1 for update; |
|||
a |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 1 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 0 |
|||
select a from monitor_test where b < 3 for update; |
|||
a |
|||
13 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 2 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 1 |
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
@ -1,616 +0,0 @@ |
|||
set global innodb_monitor_disable = All; |
|||
select name, status from information_schema.innodb_metrics; |
|||
name status |
|||
metadata_table_handles_opened disabled |
|||
metadata_table_handles_closed disabled |
|||
metadata_table_reference_count disabled |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
buffer_pool_size disabled |
|||
buffer_pool_reads disabled |
|||
buffer_pool_read_requests disabled |
|||
buffer_pool_write_requests disabled |
|||
buffer_pool_wait_free disabled |
|||
buffer_pool_read_ahead disabled |
|||
buffer_pool_read_ahead_evicted disabled |
|||
buffer_pool_pages_total disabled |
|||
buffer_pool_pages_misc disabled |
|||
buffer_pool_pages_data disabled |
|||
buffer_pool_bytes_data disabled |
|||
buffer_pool_pages_dirty disabled |
|||
buffer_pool_bytes_dirty disabled |
|||
buffer_pool_pages_free disabled |
|||
buffer_pages_created disabled |
|||
buffer_pages_written disabled |
|||
buffer_index_pages_written disabled |
|||
buffer_non_index_pages_written disabled |
|||
buffer_pages_read disabled |
|||
buffer_pages0_read disabled |
|||
buffer_index_sec_rec_cluster_reads disabled |
|||
buffer_index_sec_rec_cluster_reads_avoided disabled |
|||
buffer_data_reads disabled |
|||
buffer_data_written disabled |
|||
buffer_flush_batch_scanned disabled |
|||
buffer_flush_batch_num_scan disabled |
|||
buffer_flush_batch_scanned_per_call disabled |
|||
buffer_flush_batch_total_pages disabled |
|||
buffer_flush_batches disabled |
|||
buffer_flush_batch_pages disabled |
|||
buffer_flush_neighbor_total_pages disabled |
|||
buffer_flush_neighbor disabled |
|||
buffer_flush_neighbor_pages disabled |
|||
buffer_flush_n_to_flush_requested disabled |
|||
buffer_flush_n_to_flush_by_age disabled |
|||
buffer_flush_adaptive_avg_time_slot disabled |
|||
buffer_LRU_batch_flush_avg_time_slot disabled |
|||
buffer_flush_adaptive_avg_time_thread disabled |
|||
buffer_LRU_batch_flush_avg_time_thread disabled |
|||
buffer_flush_adaptive_avg_time_est disabled |
|||
buffer_LRU_batch_flush_avg_time_est disabled |
|||
buffer_flush_avg_time disabled |
|||
buffer_flush_adaptive_avg_pass disabled |
|||
buffer_LRU_batch_flush_avg_pass disabled |
|||
buffer_flush_avg_pass disabled |
|||
buffer_LRU_get_free_loops disabled |
|||
buffer_LRU_get_free_waits disabled |
|||
buffer_flush_avg_page_rate disabled |
|||
buffer_flush_lsn_avg_rate disabled |
|||
buffer_flush_pct_for_dirty disabled |
|||
buffer_flush_pct_for_lsn disabled |
|||
buffer_flush_sync_waits disabled |
|||
buffer_flush_adaptive_total_pages disabled |
|||
buffer_flush_adaptive disabled |
|||
buffer_flush_adaptive_pages disabled |
|||
buffer_flush_sync_total_pages disabled |
|||
buffer_flush_sync disabled |
|||
buffer_flush_sync_pages disabled |
|||
buffer_flush_background_total_pages disabled |
|||
buffer_flush_background disabled |
|||
buffer_flush_background_pages disabled |
|||
buffer_LRU_batch_scanned disabled |
|||
buffer_LRU_batch_num_scan disabled |
|||
buffer_LRU_batch_scanned_per_call disabled |
|||
buffer_LRU_batch_flush_total_pages disabled |
|||
buffer_LRU_batches_flush disabled |
|||
buffer_LRU_batch_flush_pages disabled |
|||
buffer_LRU_batch_evict_total_pages disabled |
|||
buffer_LRU_batches_evict disabled |
|||
buffer_LRU_batch_evict_pages disabled |
|||
buffer_LRU_single_flush_scanned disabled |
|||
buffer_LRU_single_flush_num_scan disabled |
|||
buffer_LRU_single_flush_scanned_per_call disabled |
|||
buffer_LRU_single_flush_failure_count disabled |
|||
buffer_LRU_get_free_search disabled |
|||
buffer_LRU_search_scanned disabled |
|||
buffer_LRU_search_num_scan disabled |
|||
buffer_LRU_search_scanned_per_call disabled |
|||
buffer_LRU_unzip_search_scanned disabled |
|||
buffer_LRU_unzip_search_num_scan disabled |
|||
buffer_LRU_unzip_search_scanned_per_call disabled |
|||
buffer_page_read_index_leaf disabled |
|||
buffer_page_read_index_non_leaf disabled |
|||
buffer_page_read_index_ibuf_leaf disabled |
|||
buffer_page_read_index_ibuf_non_leaf disabled |
|||
buffer_page_read_undo_log disabled |
|||
buffer_page_read_index_inode disabled |
|||
buffer_page_read_ibuf_free_list disabled |
|||
buffer_page_read_ibuf_bitmap disabled |
|||
buffer_page_read_system_page disabled |
|||
buffer_page_read_trx_system disabled |
|||
buffer_page_read_fsp_hdr disabled |
|||
buffer_page_read_xdes disabled |
|||
buffer_page_read_blob disabled |
|||
buffer_page_read_zblob disabled |
|||
buffer_page_read_zblob2 disabled |
|||
buffer_page_read_other disabled |
|||
buffer_page_written_index_leaf disabled |
|||
buffer_page_written_index_non_leaf disabled |
|||
buffer_page_written_index_ibuf_leaf disabled |
|||
buffer_page_written_index_ibuf_non_leaf disabled |
|||
buffer_page_written_undo_log disabled |
|||
buffer_page_written_index_inode disabled |
|||
buffer_page_written_ibuf_free_list disabled |
|||
buffer_page_written_ibuf_bitmap disabled |
|||
buffer_page_written_system_page disabled |
|||
buffer_page_written_trx_system disabled |
|||
buffer_page_written_fsp_hdr disabled |
|||
buffer_page_written_xdes disabled |
|||
buffer_page_written_blob disabled |
|||
buffer_page_written_zblob disabled |
|||
buffer_page_written_zblob2 disabled |
|||
buffer_page_written_other disabled |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs disabled |
|||
os_pending_reads disabled |
|||
os_pending_writes disabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs disabled |
|||
os_log_pending_writes disabled |
|||
trx_rw_commits disabled |
|||
trx_ro_commits disabled |
|||
trx_nl_ro_commits disabled |
|||
trx_commits_insert_update disabled |
|||
trx_rollbacks disabled |
|||
trx_rollbacks_savepoint disabled |
|||
trx_rollback_active disabled |
|||
trx_active_transactions disabled |
|||
trx_rseg_history_len disabled |
|||
trx_undo_slots_used disabled |
|||
trx_undo_slots_cached disabled |
|||
trx_rseg_current_size disabled |
|||
purge_del_mark_records disabled |
|||
purge_upd_exist_or_extern_records disabled |
|||
purge_invoked disabled |
|||
purge_undo_log_pages disabled |
|||
purge_dml_delay_usec disabled |
|||
purge_stop_count disabled |
|||
purge_resume_count disabled |
|||
log_checkpoints disabled |
|||
log_lsn_last_flush disabled |
|||
log_lsn_last_checkpoint disabled |
|||
log_lsn_current disabled |
|||
log_lsn_checkpoint_age disabled |
|||
log_lsn_buf_pool_oldest disabled |
|||
log_max_modified_age_async disabled |
|||
log_max_modified_age_sync disabled |
|||
log_pending_log_flushes disabled |
|||
log_pending_checkpoint_writes disabled |
|||
log_num_log_io disabled |
|||
log_waits disabled |
|||
log_write_requests disabled |
|||
log_writes disabled |
|||
log_padded disabled |
|||
compress_pages_compressed disabled |
|||
compress_pages_decompressed disabled |
|||
compression_pad_increments disabled |
|||
compression_pad_decrements disabled |
|||
compress_saved disabled |
|||
compress_pages_page_compressed disabled |
|||
compress_page_compressed_trim_op disabled |
|||
compress_pages_page_decompressed disabled |
|||
compress_pages_page_compression_error disabled |
|||
compress_pages_encrypted disabled |
|||
compress_pages_decrypted disabled |
|||
index_page_splits disabled |
|||
index_page_merge_attempts disabled |
|||
index_page_merge_successful disabled |
|||
index_page_reorg_attempts disabled |
|||
index_page_reorg_successful disabled |
|||
index_page_discards disabled |
|||
adaptive_hash_searches disabled |
|||
adaptive_hash_searches_btree disabled |
|||
adaptive_hash_pages_added disabled |
|||
adaptive_hash_pages_removed disabled |
|||
adaptive_hash_rows_added disabled |
|||
adaptive_hash_rows_removed disabled |
|||
adaptive_hash_rows_deleted_no_hash_entry disabled |
|||
adaptive_hash_rows_updated disabled |
|||
file_num_open_files disabled |
|||
ibuf_merges_insert disabled |
|||
ibuf_merges_delete_mark disabled |
|||
ibuf_merges_delete disabled |
|||
ibuf_merges_discard_insert disabled |
|||
ibuf_merges_discard_delete_mark disabled |
|||
ibuf_merges_discard_delete disabled |
|||
ibuf_merges disabled |
|||
ibuf_size disabled |
|||
innodb_master_thread_sleeps disabled |
|||
innodb_activity_count disabled |
|||
innodb_master_active_loops disabled |
|||
innodb_master_idle_loops disabled |
|||
innodb_background_drop_table_usec disabled |
|||
innodb_ibuf_merge_usec disabled |
|||
innodb_log_flush_usec disabled |
|||
innodb_mem_validate_usec disabled |
|||
innodb_master_purge_usec disabled |
|||
innodb_dict_lru_usec disabled |
|||
innodb_dict_lru_count_active disabled |
|||
innodb_dict_lru_count_idle disabled |
|||
innodb_checkpoint_usec disabled |
|||
innodb_dblwr_writes disabled |
|||
innodb_dblwr_pages_written disabled |
|||
innodb_page_size disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
dml_reads disabled |
|||
dml_inserts disabled |
|||
dml_deletes disabled |
|||
dml_updates disabled |
|||
dml_system_reads disabled |
|||
dml_system_inserts disabled |
|||
dml_system_deletes disabled |
|||
dml_system_updates disabled |
|||
ddl_background_drop_indexes disabled |
|||
ddl_background_drop_tables disabled |
|||
ddl_online_create_index disabled |
|||
ddl_pending_alter_table disabled |
|||
ddl_sort_file_alter_table disabled |
|||
ddl_log_file_alter_table disabled |
|||
icp_attempts disabled |
|||
icp_no_match disabled |
|||
icp_out_of_range disabled |
|||
icp_match disabled |
|||
set global innodb_monitor_enable = all; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_enable = aaa; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa' |
|||
set global innodb_monitor_disable = All; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_reset_all = all; |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
name |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
name status |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*' |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%_%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
name status |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs enabled |
|||
os_pending_reads enabled |
|||
os_pending_writes enabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs enabled |
|||
os_log_pending_writes enabled |
|||
set global innodb_monitor_enable=""; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '' |
|||
set global innodb_monitor_enable="_"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_' |
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
create index idx on monitor_test(col); |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_metadata; |
|||
set global innodb_monitor_reset = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = module_trx; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled |
|||
trx_active_transactions 1 0 0 1 0 0 enabled |
|||
set global innodb_monitor_disable = module_trx; |
|||
set global innodb_monitor_enable = module_dml; |
|||
insert into monitor_test values(9); |
|||
update monitor_test set col = 10 where col = 9; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 4 NULL 4 4 NULL 4 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 6 NULL 6 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 2 NULL 2 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 0 NULL 0 enabled |
|||
dml_inserts 1 NULL 1 0 NULL 0 enabled |
|||
dml_deletes 2 NULL 2 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 disabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 disabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 disabled |
|||
dml_updates 2 NULL 2 0 NULL 0 disabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts 2 NULL 2 2 NULL 2 enabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
drop table monitor_test; |
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
file_num_open_files # # # # # # enabled |
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
set global innodb_monitor_enable = "icp%"; |
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
insert into monitor_test values("13", 2, "aa"); |
|||
select a from monitor_test where b < 1 for update; |
|||
a |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 1 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 0 |
|||
select a from monitor_test where b < 3 for update; |
|||
a |
|||
13 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 2 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 1 |
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
@ -1,616 +0,0 @@ |
|||
set global innodb_monitor_disable = All; |
|||
select name, status from information_schema.innodb_metrics; |
|||
name status |
|||
metadata_table_handles_opened disabled |
|||
metadata_table_handles_closed disabled |
|||
metadata_table_reference_count disabled |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
buffer_pool_size disabled |
|||
buffer_pool_reads disabled |
|||
buffer_pool_read_requests disabled |
|||
buffer_pool_write_requests disabled |
|||
buffer_pool_wait_free disabled |
|||
buffer_pool_read_ahead disabled |
|||
buffer_pool_read_ahead_evicted disabled |
|||
buffer_pool_pages_total disabled |
|||
buffer_pool_pages_misc disabled |
|||
buffer_pool_pages_data disabled |
|||
buffer_pool_bytes_data disabled |
|||
buffer_pool_pages_dirty disabled |
|||
buffer_pool_bytes_dirty disabled |
|||
buffer_pool_pages_free disabled |
|||
buffer_pages_created disabled |
|||
buffer_pages_written disabled |
|||
buffer_index_pages_written disabled |
|||
buffer_non_index_pages_written disabled |
|||
buffer_pages_read disabled |
|||
buffer_pages0_read disabled |
|||
buffer_index_sec_rec_cluster_reads disabled |
|||
buffer_index_sec_rec_cluster_reads_avoided disabled |
|||
buffer_data_reads disabled |
|||
buffer_data_written disabled |
|||
buffer_flush_batch_scanned disabled |
|||
buffer_flush_batch_num_scan disabled |
|||
buffer_flush_batch_scanned_per_call disabled |
|||
buffer_flush_batch_total_pages disabled |
|||
buffer_flush_batches disabled |
|||
buffer_flush_batch_pages disabled |
|||
buffer_flush_neighbor_total_pages disabled |
|||
buffer_flush_neighbor disabled |
|||
buffer_flush_neighbor_pages disabled |
|||
buffer_flush_n_to_flush_requested disabled |
|||
buffer_flush_n_to_flush_by_age disabled |
|||
buffer_flush_adaptive_avg_time_slot disabled |
|||
buffer_LRU_batch_flush_avg_time_slot disabled |
|||
buffer_flush_adaptive_avg_time_thread disabled |
|||
buffer_LRU_batch_flush_avg_time_thread disabled |
|||
buffer_flush_adaptive_avg_time_est disabled |
|||
buffer_LRU_batch_flush_avg_time_est disabled |
|||
buffer_flush_avg_time disabled |
|||
buffer_flush_adaptive_avg_pass disabled |
|||
buffer_LRU_batch_flush_avg_pass disabled |
|||
buffer_flush_avg_pass disabled |
|||
buffer_LRU_get_free_loops disabled |
|||
buffer_LRU_get_free_waits disabled |
|||
buffer_flush_avg_page_rate disabled |
|||
buffer_flush_lsn_avg_rate disabled |
|||
buffer_flush_pct_for_dirty disabled |
|||
buffer_flush_pct_for_lsn disabled |
|||
buffer_flush_sync_waits disabled |
|||
buffer_flush_adaptive_total_pages disabled |
|||
buffer_flush_adaptive disabled |
|||
buffer_flush_adaptive_pages disabled |
|||
buffer_flush_sync_total_pages disabled |
|||
buffer_flush_sync disabled |
|||
buffer_flush_sync_pages disabled |
|||
buffer_flush_background_total_pages disabled |
|||
buffer_flush_background disabled |
|||
buffer_flush_background_pages disabled |
|||
buffer_LRU_batch_scanned disabled |
|||
buffer_LRU_batch_num_scan disabled |
|||
buffer_LRU_batch_scanned_per_call disabled |
|||
buffer_LRU_batch_flush_total_pages disabled |
|||
buffer_LRU_batches_flush disabled |
|||
buffer_LRU_batch_flush_pages disabled |
|||
buffer_LRU_batch_evict_total_pages disabled |
|||
buffer_LRU_batches_evict disabled |
|||
buffer_LRU_batch_evict_pages disabled |
|||
buffer_LRU_single_flush_scanned disabled |
|||
buffer_LRU_single_flush_num_scan disabled |
|||
buffer_LRU_single_flush_scanned_per_call disabled |
|||
buffer_LRU_single_flush_failure_count disabled |
|||
buffer_LRU_get_free_search disabled |
|||
buffer_LRU_search_scanned disabled |
|||
buffer_LRU_search_num_scan disabled |
|||
buffer_LRU_search_scanned_per_call disabled |
|||
buffer_LRU_unzip_search_scanned disabled |
|||
buffer_LRU_unzip_search_num_scan disabled |
|||
buffer_LRU_unzip_search_scanned_per_call disabled |
|||
buffer_page_read_index_leaf disabled |
|||
buffer_page_read_index_non_leaf disabled |
|||
buffer_page_read_index_ibuf_leaf disabled |
|||
buffer_page_read_index_ibuf_non_leaf disabled |
|||
buffer_page_read_undo_log disabled |
|||
buffer_page_read_index_inode disabled |
|||
buffer_page_read_ibuf_free_list disabled |
|||
buffer_page_read_ibuf_bitmap disabled |
|||
buffer_page_read_system_page disabled |
|||
buffer_page_read_trx_system disabled |
|||
buffer_page_read_fsp_hdr disabled |
|||
buffer_page_read_xdes disabled |
|||
buffer_page_read_blob disabled |
|||
buffer_page_read_zblob disabled |
|||
buffer_page_read_zblob2 disabled |
|||
buffer_page_read_other disabled |
|||
buffer_page_written_index_leaf disabled |
|||
buffer_page_written_index_non_leaf disabled |
|||
buffer_page_written_index_ibuf_leaf disabled |
|||
buffer_page_written_index_ibuf_non_leaf disabled |
|||
buffer_page_written_undo_log disabled |
|||
buffer_page_written_index_inode disabled |
|||
buffer_page_written_ibuf_free_list disabled |
|||
buffer_page_written_ibuf_bitmap disabled |
|||
buffer_page_written_system_page disabled |
|||
buffer_page_written_trx_system disabled |
|||
buffer_page_written_fsp_hdr disabled |
|||
buffer_page_written_xdes disabled |
|||
buffer_page_written_blob disabled |
|||
buffer_page_written_zblob disabled |
|||
buffer_page_written_zblob2 disabled |
|||
buffer_page_written_other disabled |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs disabled |
|||
os_pending_reads disabled |
|||
os_pending_writes disabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs disabled |
|||
os_log_pending_writes disabled |
|||
trx_rw_commits disabled |
|||
trx_ro_commits disabled |
|||
trx_nl_ro_commits disabled |
|||
trx_commits_insert_update disabled |
|||
trx_rollbacks disabled |
|||
trx_rollbacks_savepoint disabled |
|||
trx_rollback_active disabled |
|||
trx_active_transactions disabled |
|||
trx_rseg_history_len disabled |
|||
trx_undo_slots_used disabled |
|||
trx_undo_slots_cached disabled |
|||
trx_rseg_current_size disabled |
|||
purge_del_mark_records disabled |
|||
purge_upd_exist_or_extern_records disabled |
|||
purge_invoked disabled |
|||
purge_undo_log_pages disabled |
|||
purge_dml_delay_usec disabled |
|||
purge_stop_count disabled |
|||
purge_resume_count disabled |
|||
log_checkpoints disabled |
|||
log_lsn_last_flush disabled |
|||
log_lsn_last_checkpoint disabled |
|||
log_lsn_current disabled |
|||
log_lsn_checkpoint_age disabled |
|||
log_lsn_buf_pool_oldest disabled |
|||
log_max_modified_age_async disabled |
|||
log_max_modified_age_sync disabled |
|||
log_pending_log_flushes disabled |
|||
log_pending_checkpoint_writes disabled |
|||
log_num_log_io disabled |
|||
log_waits disabled |
|||
log_write_requests disabled |
|||
log_writes disabled |
|||
log_padded disabled |
|||
compress_pages_compressed disabled |
|||
compress_pages_decompressed disabled |
|||
compression_pad_increments disabled |
|||
compression_pad_decrements disabled |
|||
compress_saved disabled |
|||
compress_pages_page_compressed disabled |
|||
compress_page_compressed_trim_op disabled |
|||
compress_pages_page_decompressed disabled |
|||
compress_pages_page_compression_error disabled |
|||
compress_pages_encrypted disabled |
|||
compress_pages_decrypted disabled |
|||
index_page_splits disabled |
|||
index_page_merge_attempts disabled |
|||
index_page_merge_successful disabled |
|||
index_page_reorg_attempts disabled |
|||
index_page_reorg_successful disabled |
|||
index_page_discards disabled |
|||
adaptive_hash_searches disabled |
|||
adaptive_hash_searches_btree disabled |
|||
adaptive_hash_pages_added disabled |
|||
adaptive_hash_pages_removed disabled |
|||
adaptive_hash_rows_added disabled |
|||
adaptive_hash_rows_removed disabled |
|||
adaptive_hash_rows_deleted_no_hash_entry disabled |
|||
adaptive_hash_rows_updated disabled |
|||
file_num_open_files disabled |
|||
ibuf_merges_insert disabled |
|||
ibuf_merges_delete_mark disabled |
|||
ibuf_merges_delete disabled |
|||
ibuf_merges_discard_insert disabled |
|||
ibuf_merges_discard_delete_mark disabled |
|||
ibuf_merges_discard_delete disabled |
|||
ibuf_merges disabled |
|||
ibuf_size disabled |
|||
innodb_master_thread_sleeps disabled |
|||
innodb_activity_count disabled |
|||
innodb_master_active_loops disabled |
|||
innodb_master_idle_loops disabled |
|||
innodb_background_drop_table_usec disabled |
|||
innodb_ibuf_merge_usec disabled |
|||
innodb_log_flush_usec disabled |
|||
innodb_mem_validate_usec disabled |
|||
innodb_master_purge_usec disabled |
|||
innodb_dict_lru_usec disabled |
|||
innodb_dict_lru_count_active disabled |
|||
innodb_dict_lru_count_idle disabled |
|||
innodb_checkpoint_usec disabled |
|||
innodb_dblwr_writes disabled |
|||
innodb_dblwr_pages_written disabled |
|||
innodb_page_size disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
dml_reads disabled |
|||
dml_inserts disabled |
|||
dml_deletes disabled |
|||
dml_updates disabled |
|||
dml_system_reads disabled |
|||
dml_system_inserts disabled |
|||
dml_system_deletes disabled |
|||
dml_system_updates disabled |
|||
ddl_background_drop_indexes disabled |
|||
ddl_background_drop_tables disabled |
|||
ddl_online_create_index disabled |
|||
ddl_pending_alter_table disabled |
|||
ddl_sort_file_alter_table disabled |
|||
ddl_log_file_alter_table disabled |
|||
icp_attempts disabled |
|||
icp_no_match disabled |
|||
icp_out_of_range disabled |
|||
icp_match disabled |
|||
set global innodb_monitor_enable = all; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_enable = aaa; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa' |
|||
set global innodb_monitor_disable = All; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_reset_all = all; |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
name |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
name status |
|||
lock_deadlocks disabled |
|||
lock_timeouts disabled |
|||
lock_rec_lock_waits disabled |
|||
lock_table_lock_waits disabled |
|||
lock_rec_lock_requests disabled |
|||
lock_rec_lock_created disabled |
|||
lock_rec_lock_removed disabled |
|||
lock_rec_locks disabled |
|||
lock_table_lock_created disabled |
|||
lock_table_lock_removed disabled |
|||
lock_table_locks disabled |
|||
lock_row_lock_current_waits disabled |
|||
lock_row_lock_time disabled |
|||
lock_row_lock_time_max disabled |
|||
lock_row_lock_waits disabled |
|||
lock_row_lock_time_avg disabled |
|||
innodb_rwlock_s_spin_waits disabled |
|||
innodb_rwlock_x_spin_waits disabled |
|||
innodb_rwlock_sx_spin_waits disabled |
|||
innodb_rwlock_s_spin_rounds disabled |
|||
innodb_rwlock_x_spin_rounds disabled |
|||
innodb_rwlock_sx_spin_rounds disabled |
|||
innodb_rwlock_s_os_waits disabled |
|||
innodb_rwlock_x_os_waits disabled |
|||
innodb_rwlock_sx_os_waits disabled |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*' |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="%"; |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
name |
|||
set global innodb_monitor_disable="%_%"; |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
name |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
name |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
name status |
|||
os_data_reads disabled |
|||
os_data_writes disabled |
|||
os_data_fsyncs enabled |
|||
os_pending_reads enabled |
|||
os_pending_writes enabled |
|||
os_log_bytes_written disabled |
|||
os_log_fsyncs disabled |
|||
os_log_pending_fsyncs enabled |
|||
os_log_pending_writes enabled |
|||
set global innodb_monitor_enable=""; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '' |
|||
set global innodb_monitor_enable="_"; |
|||
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_' |
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
drop table monitor_test; |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
select * from monitor_test; |
|||
col |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
create index idx on monitor_test(col); |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled |
|||
metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_metadata; |
|||
set global innodb_monitor_reset = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled |
|||
metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled |
|||
metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = module_trx; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled |
|||
trx_active_transactions 1 0 0 1 0 0 enabled |
|||
set global innodb_monitor_disable = module_trx; |
|||
set global innodb_monitor_enable = module_dml; |
|||
insert into monitor_test values(9); |
|||
update monitor_test set col = 10 where col = 9; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 4 NULL 4 4 NULL 4 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 6 NULL 6 enabled |
|||
dml_inserts 1 NULL 1 1 NULL 1 enabled |
|||
dml_deletes 2 NULL 2 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 2 NULL 2 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 6 NULL 6 0 NULL 0 enabled |
|||
dml_inserts 1 NULL 1 0 NULL 0 enabled |
|||
dml_deletes 2 NULL 2 0 NULL 0 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 enabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 enabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 enabled |
|||
dml_updates 2 NULL 2 0 NULL 0 enabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 enabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads 8 NULL 8 2 NULL 2 disabled |
|||
dml_inserts 3 NULL 3 2 NULL 2 disabled |
|||
dml_deletes 4 NULL 4 2 NULL 2 disabled |
|||
dml_updates 2 NULL 2 0 NULL 0 disabled |
|||
dml_system_reads 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled |
|||
dml_system_updates 0 NULL 0 0 NULL 0 disabled |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
delete from monitor_test; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
dml_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_inserts 2 NULL 2 2 NULL 2 enabled |
|||
dml_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_updates NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled |
|||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled |
|||
set global innodb_monitor_disable = module_dml; |
|||
drop table monitor_test; |
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
name max_count min_count count max_count_reset min_count_reset count_reset status |
|||
file_num_open_files # # # # # # enabled |
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
set global innodb_monitor_enable = "icp%"; |
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
insert into monitor_test values("13", 2, "aa"); |
|||
select a from monitor_test where b < 1 for update; |
|||
a |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 1 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 0 |
|||
select a from monitor_test where b < 3 for update; |
|||
a |
|||
13 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
name count |
|||
icp_attempts 2 |
|||
icp_no_match 0 |
|||
icp_out_of_range 1 |
|||
icp_match 1 |
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
@ -1,378 +0,0 @@ |
|||
# This is the test for Metrics Monitor Table feature. |
|||
# Test the metrics monitor system's control system |
|||
# and counter accuracy. |
|||
|
|||
--source include/have_innodb.inc |
|||
set global innodb_monitor_disable = All; |
|||
# Test turn on/off the monitor counter with "all" option |
|||
# By default, they will be off |
|||
select name, status from information_schema.innodb_metrics; |
|||
|
|||
# Turn on all monitor counters |
|||
set global innodb_monitor_enable = all; |
|||
|
|||
# status should all change to "enabled" |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Test wrong argument to the global configure option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = aaa; |
|||
|
|||
# We require a valid monitor counter/module name. There is no default |
|||
# counter name or module. A warning will be printed asking user to |
|||
# specify a valid counter name. |
|||
#--disable_warnings |
|||
#set global innodb_monitor_enable = default; |
|||
#--enable_warnings |
|||
|
|||
# Turn off all monitor counters, option name should be case |
|||
# insensitive |
|||
set global innodb_monitor_disable = All; |
|||
|
|||
# status should all change to "disabled" |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
# count should all change to 0 |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
|
|||
# Test wildcard match, turn on all counters contain string "lock" |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
|
|||
# All lock related counter should be enabled |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
|
|||
# Disable them |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
|
|||
# All lock related counter should be disabled |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
|
|||
# No match for "%lock*" |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
|
|||
# All counters will be turned on with wildcard match string with all "%" |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all counters |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# One more round testing. All counters will be turned on with |
|||
# single wildcard character "%" |
|||
set global innodb_monitor_enable="%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all the counters with "%_%" |
|||
set global innodb_monitor_disable="%_%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Turn on all counters start with "log" |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
|
|||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_" |
|||
# is single character wildcard match word |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
|
|||
# Turn on counters whose name contains "os" and "pending" with |
|||
# wildcard match "os%pending%" |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
|
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
|
|||
# Empty string is an invalid option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable=""; |
|||
|
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable="_"; |
|||
|
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
# Only turn on "table_open" counter |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# This will open the monitor_test table |
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment by 1 |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset the counter value while counter is still on (started) |
|||
# This will reset value "count_reset" but not |
|||
# "count" |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again to increment "metadata_table_handles_opened" again |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Cannot reset all monitor value while the counter is on |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn off the counter "metadata_table_handles_opened" |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
|
|||
# Reset the counter value while counter is off (disabled) |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again. Since monitor is off, "metadata_table_handles_opened" |
|||
# should not be incremented |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select * from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset all the counters, include those counter *_since_start |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn on "table_open" counter again |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Test metadata_table_handles_opened again to see if it is working correctly |
|||
# after above round of turning on/off/reset |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Test counter "metadata_table_handles_closed", |
|||
# create index will close the old handle |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
|
|||
create index idx on monitor_test(col); |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Reset counters only in "module_metadata" module |
|||
set global innodb_monitor_disable = module_metadata; |
|||
|
|||
set global innodb_monitor_reset = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Test Transaction Module |
|||
set global innodb_monitor_enable = module_trx; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
|
|||
set global innodb_monitor_disable = module_trx; |
|||
|
|||
# Test DML Module |
|||
set global innodb_monitor_enable = module_dml; |
|||
|
|||
insert into monitor_test values(9); |
|||
|
|||
update monitor_test set col = 10 where col = 9; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# test reset counter while the counter is on |
|||
set global innodb_monitor_reset = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# insert/delete some rows after the reset |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# We do not allow reset_all while the counter is on, nothing |
|||
# should be reset here |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Turn off the counter |
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Open individual counter "dml_inserts" |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
|
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
# Only counter "dml_inserts" should be updated |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
drop table monitor_test; |
|||
|
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
|
|||
# Counters are unpredictable when innodb-file-per-table is on |
|||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
|
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
|
|||
# Test ICP module counters |
|||
set global innodb_monitor_enable = "icp%"; |
|||
|
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
|
|||
insert into monitor_test values("13", 2, "aa"); |
|||
|
|||
select a from monitor_test where b < 1 for update; |
|||
|
|||
# should have icp_attempts = 1 and icp_out_of_range = 1 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
# should have icp_attempts = 2 and icp_match = 1 |
|||
select a from monitor_test where b < 3 for update; |
|||
|
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
-- disable_warnings |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
-- enable_warnings |
|||
@ -1,378 +0,0 @@ |
|||
# This is the test for Metrics Monitor Table feature. |
|||
# Test the metrics monitor system's control system |
|||
# and counter accuracy. |
|||
|
|||
--source include/have_innodb.inc |
|||
set global innodb_monitor_disable = All; |
|||
# Test turn on/off the monitor counter with "all" option |
|||
# By default, they will be off |
|||
select name, status from information_schema.innodb_metrics; |
|||
|
|||
# Turn on all monitor counters |
|||
set global innodb_monitor_enable = all; |
|||
|
|||
# status should all change to "enabled" |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Test wrong argument to the global configure option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = aaa; |
|||
|
|||
# We require a valid monitor counter/module name. There is no default |
|||
# counter name or module. A warning will be printed asking user to |
|||
# specify a valid counter name. |
|||
#--disable_warnings |
|||
#set global innodb_monitor_enable = default; |
|||
#--enable_warnings |
|||
|
|||
# Turn off all monitor counters, option name should be case |
|||
# insensitive |
|||
set global innodb_monitor_disable = All; |
|||
|
|||
# status should all change to "disabled" |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
# count should all change to 0 |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
|
|||
# Test wildcard match, turn on all counters contain string "lock" |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
|
|||
# All lock related counter should be enabled |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
|
|||
# Disable them |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
|
|||
# All lock related counter should be disabled |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
|
|||
# No match for "%lock*" |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
|
|||
# All counters will be turned on with wildcard match string with all "%" |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all counters |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# One more round testing. All counters will be turned on with |
|||
# single wildcard character "%" |
|||
set global innodb_monitor_enable="%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all the counters with "%_%" |
|||
set global innodb_monitor_disable="%_%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Turn on all counters start with "log" |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
|
|||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_" |
|||
# is single character wildcard match word |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
|
|||
# Turn on counters whose name contains "os" and "pending" with |
|||
# wildcard match "os%pending%" |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
|
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
|
|||
# Empty string is an invalid option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable=""; |
|||
|
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable="_"; |
|||
|
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
# Only turn on "table_open" counter |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# This will open the monitor_test table |
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment by 1 |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset the counter value while counter is still on (started) |
|||
# This will reset value "count_reset" but not |
|||
# "count" |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again to increment "metadata_table_handles_opened" again |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Cannot reset all monitor value while the counter is on |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn off the counter "metadata_table_handles_opened" |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
|
|||
# Reset the counter value while counter is off (disabled) |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again. Since monitor is off, "metadata_table_handles_opened" |
|||
# should not be incremented |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select * from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset all the counters, include those counter *_since_start |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn on "table_open" counter again |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Test metadata_table_handles_opened again to see if it is working correctly |
|||
# after above round of turning on/off/reset |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Test counter "metadata_table_handles_closed", |
|||
# create index will close the old handle |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
|
|||
create index idx on monitor_test(col); |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Reset counters only in "module_metadata" module |
|||
set global innodb_monitor_disable = module_metadata; |
|||
|
|||
set global innodb_monitor_reset = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Test Transaction Module |
|||
set global innodb_monitor_enable = module_trx; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
|
|||
set global innodb_monitor_disable = module_trx; |
|||
|
|||
# Test DML Module |
|||
set global innodb_monitor_enable = module_dml; |
|||
|
|||
insert into monitor_test values(9); |
|||
|
|||
update monitor_test set col = 10 where col = 9; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# test reset counter while the counter is on |
|||
set global innodb_monitor_reset = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# insert/delete some rows after the reset |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# We do not allow reset_all while the counter is on, nothing |
|||
# should be reset here |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Turn off the counter |
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Open individual counter "dml_inserts" |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
|
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
# Only counter "dml_inserts" should be updated |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
drop table monitor_test; |
|||
|
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
|
|||
# Counters are unpredictable when innodb-file-per-table is on |
|||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
|
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
|
|||
# Test ICP module counters |
|||
set global innodb_monitor_enable = "icp%"; |
|||
|
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
|
|||
insert into monitor_test values("13", 2, "aa"); |
|||
|
|||
select a from monitor_test where b < 1 for update; |
|||
|
|||
# should have icp_attempts = 1 and icp_out_of_range = 1 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
# should have icp_attempts = 2 and icp_match = 1 |
|||
select a from monitor_test where b < 3 for update; |
|||
|
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
-- disable_warnings |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
-- enable_warnings |
|||
@ -1,378 +0,0 @@ |
|||
# This is the test for Metrics Monitor Table feature. |
|||
# Test the metrics monitor system's control system |
|||
# and counter accuracy. |
|||
|
|||
--source include/have_innodb.inc |
|||
set global innodb_monitor_disable = All; |
|||
# Test turn on/off the monitor counter with "all" option |
|||
# By default, they will be off |
|||
select name, status from information_schema.innodb_metrics; |
|||
|
|||
# Turn on all monitor counters |
|||
set global innodb_monitor_enable = all; |
|||
|
|||
# status should all change to "enabled" |
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Test wrong argument to the global configure option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = aaa; |
|||
|
|||
# We require a valid monitor counter/module name. There is no default |
|||
# counter name or module. A warning will be printed asking user to |
|||
# specify a valid counter name. |
|||
#--disable_warnings |
|||
#set global innodb_monitor_enable = default; |
|||
#--enable_warnings |
|||
|
|||
# Turn off all monitor counters, option name should be case |
|||
# insensitive |
|||
set global innodb_monitor_disable = All; |
|||
|
|||
# status should all change to "disabled" |
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
# count should all change to 0 |
|||
select name from information_schema.innodb_metrics where count!=0; |
|||
|
|||
# Test wildcard match, turn on all counters contain string "lock" |
|||
set global innodb_monitor_enable = "%lock%"; |
|||
|
|||
# All lock related counter should be enabled |
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "%lock%", 'enabled', 'disabled'); |
|||
|
|||
# Disable them |
|||
set global innodb_monitor_disable = "%lock%"; |
|||
|
|||
# All lock related counter should be disabled |
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "%lock%"; |
|||
|
|||
# No match for "%lock*" |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable = "%lock*"; |
|||
|
|||
# All counters will be turned on with wildcard match string with all "%" |
|||
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all counters |
|||
set global innodb_monitor_disable="%%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# One more round testing. All counters will be turned on with |
|||
# single wildcard character "%" |
|||
set global innodb_monitor_enable="%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='enabled'; |
|||
|
|||
# Turn off all the counters with "%_%" |
|||
set global innodb_monitor_disable="%_%"; |
|||
|
|||
select name from information_schema.innodb_metrics where status!='disabled'; |
|||
|
|||
# Turn on all counters start with "log" |
|||
set global innodb_monitor_enable="log%%%%"; |
|||
|
|||
select name from information_schema.innodb_metrics |
|||
where status != IF(name like "log%", 'enabled', 'disabled'); |
|||
|
|||
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_" |
|||
# is single character wildcard match word |
|||
set global innodb_monitor_enable="os_%a_fs_ncs"; |
|||
|
|||
# Turn on counters whose name contains "os" and "pending" with |
|||
# wildcard match "os%pending%" |
|||
set global innodb_monitor_enable="os%pending%"; |
|||
|
|||
select name, status from information_schema.innodb_metrics |
|||
where name like "os%"; |
|||
|
|||
# Empty string is an invalid option |
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable=""; |
|||
|
|||
--error ER_WRONG_VALUE_FOR_VAR |
|||
set global innodb_monitor_enable="_"; |
|||
|
|||
SET global innodb_monitor_disable = module_metadata; |
|||
SET global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
# Only turn on "table_open" counter |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# This will open the monitor_test table |
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment by 1 |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset the counter value while counter is still on (started) |
|||
# This will reset value "count_reset" but not |
|||
# "count" |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again to increment "metadata_table_handles_opened" again |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Cannot reset all monitor value while the counter is on |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn off the counter "metadata_table_handles_opened" |
|||
set global innodb_monitor_disable = metadata_table_handles_opened; |
|||
|
|||
# Reset the counter value while counter is off (disabled) |
|||
set global innodb_monitor_reset = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# re-create table again. Since monitor is off, "metadata_table_handles_opened" |
|||
# should not be incremented |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select * from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Reset all the counters, include those counter *_since_start |
|||
set global innodb_monitor_reset_all = metadata_table_handles_opened; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Turn on "table_open" counter again |
|||
set global innodb_monitor_enable = metadata_table_handles_opened; |
|||
|
|||
# Test metadata_table_handles_opened again to see if it is working correctly |
|||
# after above round of turning on/off/reset |
|||
drop table monitor_test; |
|||
|
|||
# Create a new table to test "metadata_table_handles_opened" counter |
|||
create table monitor_test(col int) engine = innodb stats_persistent=0; |
|||
|
|||
select * from monitor_test; |
|||
|
|||
# "metadata_table_handles_opened" should increment |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_opened"; |
|||
|
|||
# Test counter "metadata_table_handles_closed", |
|||
# create index will close the old handle |
|||
set global innodb_monitor_enable = metadata_table_handles_closed; |
|||
|
|||
create index idx on monitor_test(col); |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name = "metadata_table_handles_closed"; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Reset counters only in "module_metadata" module |
|||
set global innodb_monitor_disable = module_metadata; |
|||
|
|||
set global innodb_monitor_reset = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
set global innodb_monitor_reset_all = module_metadata; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "metadata%"; |
|||
|
|||
# Test Transaction Module |
|||
set global innodb_monitor_enable = module_trx; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
commit; |
|||
|
|||
begin; |
|||
insert into monitor_test values(9); |
|||
rollback; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "trx_rollbacks" or name like "trx_active_transactions"; |
|||
|
|||
set global innodb_monitor_disable = module_trx; |
|||
|
|||
# Test DML Module |
|||
set global innodb_monitor_enable = module_dml; |
|||
|
|||
insert into monitor_test values(9); |
|||
|
|||
update monitor_test set col = 10 where col = 9; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# test reset counter while the counter is on |
|||
set global innodb_monitor_reset = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# insert/delete some rows after the reset |
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# We do not allow reset_all while the counter is on, nothing |
|||
# should be reset here |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Turn off the counter |
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Reset all counter values |
|||
set global innodb_monitor_reset_all = module_dml; |
|||
|
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
# Open individual counter "dml_inserts" |
|||
set global innodb_monitor_enable = dml_inserts; |
|||
|
|||
insert into monitor_test values(9); |
|||
insert into monitor_test values(1); |
|||
|
|||
delete from monitor_test; |
|||
|
|||
# Only counter "dml_inserts" should be updated |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "dml%"; |
|||
|
|||
set global innodb_monitor_disable = module_dml; |
|||
|
|||
drop table monitor_test; |
|||
|
|||
set global innodb_monitor_enable = file_num_open_files; |
|||
|
|||
# Counters are unpredictable when innodb-file-per-table is on |
|||
--replace_column 2 # 3 # 4 # 5 # 6 # 7 # |
|||
select name, max_count, min_count, count, |
|||
max_count_reset, min_count_reset, count_reset, status |
|||
from information_schema.innodb_metrics |
|||
where name like "file_num_open_files"; |
|||
|
|||
set global innodb_monitor_disable = file_num_open_files; |
|||
|
|||
# Test ICP module counters |
|||
set global innodb_monitor_enable = "icp%"; |
|||
|
|||
create table monitor_test(a char(3), b int, c char(2), |
|||
primary key (a(1), c(1)), key(b)) engine = innodb; |
|||
|
|||
insert into monitor_test values("13", 2, "aa"); |
|||
|
|||
select a from monitor_test where b < 1 for update; |
|||
|
|||
# should have icp_attempts = 1 and icp_out_of_range = 1 |
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
# should have icp_attempts = 2 and icp_match = 1 |
|||
select a from monitor_test where b < 3 for update; |
|||
|
|||
select name, count from information_schema.innodb_metrics |
|||
where name like "icp%"; |
|||
|
|||
drop table monitor_test; |
|||
set global innodb_monitor_disable = All; |
|||
set global innodb_monitor_reset_all = all; |
|||
|
|||
-- disable_warnings |
|||
set global innodb_monitor_enable = default; |
|||
set global innodb_monitor_disable = default; |
|||
set global innodb_monitor_reset = default; |
|||
set global innodb_monitor_reset_all = default; |
|||
-- enable_warnings |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue