| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
--source include/not_embedded.inc |
| 4 |
--source include/have_perfschema.inc |
| 5 |
|
| 6 |
# Verify that the configuration options were applied correctly to the |
| 7 |
# performance_schema.setup_instruments table. These instruments that are known to persist across |
| 8 |
# platforms and the various compile options. |
| 9 |
|
| 10 |
--echo # |
| 11 |
--echo # Verify that the configuration file defaults were processed correctly |
| 12 |
--echo # |
| 13 |
|
| 14 |
SELECT * FROM performance_schema.setup_instruments |
| 15 |
WHERE name IN ( |
| 16 |
'wait/synch/mutex/sql/LOCK_user_conn', |
| 17 |
'wait/synch/mutex/sql/LOCK_uuid_generator', |
| 18 |
'wait/synch/mutex/sql/LOCK_plugin', |
| 19 |
'stage/sql/creating table') |
| 20 |
AND enabled = 'yes' AND timed = 'no' |
| 21 |
ORDER BY name; |
| 22 |
|
| 23 |
SELECT * FROM performance_schema.setup_instruments |
| 24 |
WHERE name = 'wait/synch/mutex/sql/LOCK_thd_list' |
| 25 |
AND enabled = 'no' AND timed = 'no'; |
| 26 |
|
| 27 |
SELECT * FROM performance_schema.setup_instruments |
| 28 |
WHERE name IN ( |
| 29 |
'wait/synch/mutex/sql/LOG_INFO::lock', |
| 30 |
'wait/synch/mutex/sql/THD::LOCK_thd_list') |
| 31 |
AND enabled = 'yes' AND timed = 'yes' |
| 32 |
ORDER BY name; |
| 33 |
|
| 34 |
SELECT * FROM performance_schema.setup_instruments |
| 35 |
WHERE name = 'wait/synch/mutex/sql/hash_filo::lock' |
| 36 |
AND enabled = 'no' AND timed = 'no' |
| 37 |
ORDER BY name; |
| 38 |
|
| 39 |
--echo # |
| 40 |
--echo # Verify that the memory instruments are never timed |
| 41 |
--echo # |
| 42 |
SELECT * FROM performance_schema.setup_instruments |
| 43 |
WHERE name like 'memory/%' |
| 44 |
AND timed = 'YES'; |
| 45 |
|
| 46 |
--echo # |
| 47 |
--echo # Verify that the memory/performance_schema instruments are never disabled |
| 48 |
--echo # |
| 49 |
SELECT * FROM performance_schema.setup_instruments |
| 50 |
WHERE name like 'memory/performance_schema/%' |
| 51 |
AND enabled = 'NO'; |
| 52 |
|
| 53 |
|
| 54 |
--echo # |
| 55 |
--echo # Verify that the instrument startup settings are not not visible. |
| 56 |
--echo # |
| 57 |
SHOW VARIABLES LIKE "%/wait/synch/mutex%"; |
| 58 |
|
| 59 |
--echo # |
| 60 |
--echo # Verify command line options are processed correctly |
| 61 |
--echo # |
| 62 |
|
| 63 |
# The instrument wait/io/table/sql/handler should be enabled and timed. We will |
| 64 |
# restart the server with the instrument disabled from the command line. |
| 65 |
--echo # |
| 66 |
--echo # Verify that wait/io/table/sql/handler is enabled and timed |
| 67 |
--echo # |
| 68 |
SELECT * FROM performance_schema.setup_instruments |
| 69 |
WHERE name like "%wait/io/table/sql/handler%"; |
| 70 |
|
| 71 |
# Write file to make mysql-test-run.pl wait for the server to stop |
| 72 |
--write_line wait $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 73 |
|
| 74 |
# Restart the server |
| 75 |
--echo # |
| 76 |
--echo # Stop server |
| 77 |
--send_shutdown |
| 78 |
--source include/wait_until_disconnected.inc |
| 79 |
|
| 80 |
--echo # Restart server with wait/io/table/sql/handler disabled |
| 81 |
|
| 82 |
--write_line "restart:--loose-performance-schema-instrument=%wait/io/table/sql/%=off" $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 83 |
|
| 84 |
# Turn on reconnect |
| 85 |
--echo # Enable reconnect |
| 86 |
--enable_reconnect |
| 87 |
|
| 88 |
# Wait for server to be back online again |
| 89 |
--echo # Wait until connected again |
| 90 |
--source include/wait_until_connected_again.inc |
| 91 |
|
| 92 |
# Turn off reconnect again |
| 93 |
--echo # Disable reconnect |
| 94 |
--disable_reconnect |
| 95 |
|
| 96 |
--echo # |
| 97 |
--echo # Verify that wait/io/table is disabled |
| 98 |
--echo # |
| 99 |
SELECT * FROM performance_schema.setup_instruments |
| 100 |
WHERE name like "%wait/io/table/sql/handler%"; |