文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

29.4.10 确定已加入仪器的内容29.4.10 Determining What Is Instrumented

总是可以通过检查 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, TIMED
       FROM performance_schema.setup_instruments
       WHERE 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 the setup_instruments table. 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.