The setup_instruments Table
The setup_instruments table lists classes of instrumented objects for which events can be collected:
mysql> SELECT * FROM setup_instruments;
+------------------------------------------------------------+---------+-------+
| NAME | ENABLED | TIMED |
+------------------------------------------------------------+---------+-------+
...
| wait/synch/mutex/sql/LOCK_global_read_lock | YES | YES |
| wait/synch/mutex/sql/LOCK_global_system_variables | YES | YES |
| wait/synch/mutex/sql/LOCK_lock_db | YES | YES |
| wait/synch/mutex/sql/LOCK_manager | YES | YES |
...
| wait/synch/rwlock/sql/LOCK_grant | YES | YES |
| wait/synch/rwlock/sql/LOGGER::LOCK_logger | YES | YES |
| wait/synch/rwlock/sql/LOCK_sys_init_connect | YES | YES |
| wait/synch/rwlock/sql/LOCK_sys_init_slave | YES | YES |
...
| wait/io/file/sql/binlog | YES | YES |
| wait/io/file/sql/binlog_index | YES | YES |
| wait/io/file/sql/casetest | YES | YES |
| wait/io/file/sql/dbopt | YES | YES |
...
Each instrument added to the source code provides a row for this table, even when the instrumented code is not executed. When an instrument is enabled and executed, instrumented instances are created, which are visible in the *_instances tables.
The setup_instruments table has these columns:
NAMEThe instrument name. Instrument names have multiple parts and form a hierarchy, as discussed in , "Performance Schema Instrument Naming Conventions". Events produced from execution of an instrument have an
EVENT_NAMEvalue that is taken from the instrumentNAMEvalue. (Events do not really have a "name," but this provides a way to associate events with instruments.)ENABLEDWhether the instrument is enabled. This column can be modified. A disabled instrument produces no events.
TIMEDWhether the instrument is timed. This column can be modified.
If an enabled instrument is not timed, the instrument code is enabled, but the timer is not. Events produced by the instrument have
NULLfor theTIMER_START,TIMER_END, andTIMER_WAITtimer values. This in turn causes those values to be ignored when calculating the sum, minimum, maximum, and average time values in summary tables.
Modifications to the setup_instruments table affect monitoring immediately.
For more information about the role of the setup_instruments table in event filtering, see , "Event Pre-Filtering".