Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要构建一个测试/检查器(ruby、python、bash、你的个人偏好),它将每隔几分钟检查一次长时间运行的查询。它将与sensu结合,如果达到阈值则报警。Sensu 将能够发出警报(或者我可以设置自定义松弛通知)
老实说,我什至不知道从哪里开始。我真的在寻找你们将如何处理这个问题。任何帮助都会很棒!
如果有帮助的话,我可以提供一个我用来测试数据库上其他东西的样本。
您可以在检查器的上下文中执行以下查询以激活慢查询日志并读取记录慢查询内容的文件的名称:
set global log_slow_queries = 'ON';
show global variables like '%slow_query_log_file%'
然后,您可以监视文件以查找慢速查询。