总是可以通过检查 setup_instruments 表来确定性能模式包含哪些仪器。例如,要查看 InnoDB 存储引擎已对哪些文件相关事件进行仪器化,请使用以下查询:It is always possible to determine what instruments the
Performance Schema includes by checking the
setup_instruments table. For
example, to see what file-related events are instrumented for
the InnoDB storage engine, use this query:
mysql>SELECT NAME, ENABLED, TIMEDFROM performance_schema.setup_instrumentsWHERE NAME LIKE 'wait/io/file/innodb/%';+-------------------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +-------------------------------------------------+---------+-------+ | wait/io/file/innodb/innodb_tablespace_open_file | YES | YES | | wait/io/file/innodb/innodb_data_file | YES | YES | | wait/io/file/innodb/innodb_log_file | YES | YES | | wait/io/file/innodb/innodb_temp_file | YES | YES | | wait/io/file/innodb/innodb_arch_file | YES | YES | | wait/io/file/innodb/innodb_clone_file | YES | YES | +-------------------------------------------------+---------+-------+
这份文档并未详尽描述具体进行了哪些监控,原因有几方面:An exhaustive description of precisely what is instrumented is not given in this documentation, for several reasons:
被监控的是服务器代码。该代码经常发生变化,这也会影响监控项的集合。What is instrumented is the server code. Changes to this code occur often, which also affects the set of instruments.
列出所有监控项并不现实,因为它们有数百个。It is not practical to list all the instruments because there are hundreds of them.
如前所述,可以通过查询
setup_instruments表来获取。这些信息始终针对您使用的 MySQL 版本保持最新,同时还包括您可能安装的、非核心服务器插件的监控项,并且可以被自动化工具使用。As described earlier, it is possible to find out by querying thesetup_instrumentstable. This information is always up to date for your version of MySQL, also includes instrumentation for instrumented plugins you might have installed that are not part of the core server, and can be used by automated tools.