Skip to content

setup_instruments和setup_consumers配置协作示例

xiaoboluo768 edited this page Jun 8, 2020 · 2 revisions
  • 现在,我们来看看如何通过修改instruments和consumers配置表来实现打开或者关闭某类或某个事件的收集与记录功能
# 关闭等待事件wait/synch/mutex/myisammrg/MYRG_INFO::mutex的收集和记录,使用如下语句更新setup_instruments和setup_consumers表:
mysql> UPDATE setup_instruments SET ENABLED ='NO' WHERE NAME ='wait/synch/mutex/myisammrg/MYRG_INFO::mutex';

mysql> UPDATE setup_consumers SET ENABLED ='NO' WHERE NAME ='events_waits_current';

# 关闭一组等待事件的收集和记录功能,通过如下语句更新setup_instruments和setup_consumers表
mysql> UPDATE setup_instruments SET ENABLED ='NO' WHERE NAME LIKE'wait/synch/mutex/%';

mysql> UPDATE setup_consumers SET ENABLED ='NO' where name like '%history%';

# 如果您需要打开或者关闭所有file类的等待事件的收集功能,则,可以使用如下where条件+ like模糊匹配值(LIKE 'wait/io/file/%')来修改setup_instruments表:
... WHERE NAME LIKE 'wait/io/file/%';

# 如果你需要打开或者关闭所有file类的所有事件的收集功能,则,可以使用如下where条件+ like模糊匹配值(LIKE '%/file/%')来修改setup_instruments表(要注意,不要使用'%file%',这样可能匹配到如:"wait/synch/mutex/sql/LOCK_des_key_file"这样的instruments):
... WHERE NAME LIKE '%/file/%';

# 要查看某些instruments配置信息,某些consumers的配置信息,可以使用NAME字段结合LIKE关键字做模糊匹配,如下:
mysql> SELECT NAME FROM setup_instruments WHERE NAME LIKE'pattern';

mysql> SELECT NAME FROM setup_consumers WHERE NAME LIKE'pattern';

上一篇: Pre Filtering by consumers | 下一篇: setup_actors表

Clone this wiki locally