--source include/have_ndb.inc --echo # ###################################################################### --echo # * General information * --echo # Instruments in the ndbcluster plugin uses the "ndbcluster" --echo # identifier plus a name which normally is the name of the --echo # object in the code. The prefix is decided by performance_schema and --echo # depends on the objects type. --echo # ie. /ndbcluster/. --echo # All available instruments, their doc string etc are listed in the --echo # setup_instruments table. --echo # The system variables are prefixed with "ndb" and can be --echo # queried to see either global or session variables SELECT COUNT(*) > 10 FROM performance_schema.global_variables WHERE VARIABLE_NAME LIKE 'ndb%'; SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME = 'ndb_use_copying_alter_table'; --echo # It's possible to see values of session variable for each thread --replace_column 1 SELECT * FROM performance_schema.variables_by_thread WHERE VARIABLE_NAME = 'ndb_use_transactions'; --echo # It's possible to query information about each variable SELECT VARIABLE_NAME FROM performance_schema.variables_info WHERE VARIABLE_NAME = 'ndb_version'; --echo # The status variables are prefixed with "Ndb" and can be --echo # queried to see either global or session status SELECT COUNT(*) > 10 FROM performance_schema.global_status WHERE VARIABLE_NAME LIKE 'Ndb%'; SELECT * FROM performance_schema.session_status WHERE VARIABLE_NAME = 'Ndb_replica_max_replicated_epoch'; --echo # The threads created by the ndbcluster plugin can be queried, this --echo # provide a mapping to OS thread id --replace_column 1 4 SELECT THREAD_ID, NAME, TYPE, THREAD_OS_ID FROM performance_schema.threads WHERE NAME LIKE "thread/ndbcluster/%" ORDER BY NAME; --echo # The threads created by the ndbcluster plugin can be used to query --echo # the amount of memory allocated by those from the mem_root arena SELECT IF(PFS_MEM.SUM_NUMBER_OF_BYTES_ALLOC > 0, "true", "false") AS has_alloc_mem FROM performance_schema.memory_summary_by_thread_by_event_name PFS_MEM JOIN performance_schema.threads PFS_THR ON PFS_MEM.THREAD_ID = PFS_THR.THREAD_ID WHERE PFS_THR.name LIKE '%ndb_binlog%' AND EVENT_NAME LIKE '%THD::main_mem_root%'; --echo # The amount of memory used when accessing DD from ndbcluster plugin --echo # threads can be queried SELECT IF(PFS_MEM.SUM_NUMBER_OF_BYTES_ALLOC > 0, "true", "false") AS has_alloc_mem FROM performance_schema.memory_summary_by_thread_by_event_name PFS_MEM JOIN performance_schema.threads PFS_THR ON PFS_MEM.THREAD_ID = PFS_THR.THREAD_ID WHERE PFS_THR.name LIKE '%ndb_binlog%' AND EVENT_NAME LIKE '%Ndb_dd_client::dd_mem_root%'; --echo # The instrumented memory roots can be queried SELECT EVENT_NAME FROM performance_schema.memory_summary_by_thread_by_event_name WHERE THREAD_ID = PS_CURRENT_THREAD_ID() AND EVENT_NAME LIKE 'memory/ndbcluster/%'; --echo # Log messages written by ndbcluster plugin can be queried --echo # using the error_log table where the SUBSYSTEM column is --echo # set to "NDB" query_vertical SELECT THREAD_ID, PRIO, ERROR_CODE, SUBSYSTEM, DATA FROM performance_schema.error_log WHERE SUBSYSTEM = "NDB" AND DATA LIKE "%all storage nodes connected%"; --echo # Log messages written by ndbcluster plugin components that call into --echo # MySQL (need a THD) must have a thread_id (THD id) assigned query_vertical SELECT LEFT(DATA,LOCATE(':',DATA)-1) as component, IF(THREAD_ID > 0, "true", "false") AS has_thread_id FROM performance_schema.error_log WHERE SUBSYSTEM = "NDB" AND DATA LIKE "%: Started%" ORDER BY DATA;