从 Postgres 统计收集器获取信息
我正在开发一个小工具来收集有关我们的 postgres 数据库的信息,并且我一直在考虑使用 postgres 统计收集器。表中似乎有很多信息/统计数据,但我无法理解它们到底意味着什么。
如果有人以前使用过这些视图,他们是否能够为我指明如何获取统计信息(例如当前正在运行的查询的数量或最慢的查询的数量)的正确方向?如果 postgres 统计收集器无法实现这些,是否还有其他方法可以使用来获取统计信息?
我感到困惑的另一件事是统计收集器是否限制数据量:例如,它只会记录最后的 x 服务器进程吗?
I'm working on small tool for gathering information about our postgres database and I have been looking at using the postgres Stats Collecter. It seems like there is a lot of info/stats in the table but I am having trouble understanding what exactly it all means.
If someone has used these views before would they be able to point me in the right direction for how to obtain stats such as the number of currently running queries or the slowest query? If these aren't possible from the postgres stats collector is there some other method for obtaining statistics that I could use?
One other thing I was confused about is if the stats collector limits the amount of data: for instance, will it only record the last x server processes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您查看其他已经运行的监控工具 - 例如 Nagios 的 Munin 或 check_postgres。
具体来说,对于您在这里询问的内容,请查看视图 pg_stat_activity。
不,统计收集器会跟踪一切。
I suggest you look at what other monitoring tools already run - such as Munin or check_postgres for Nagios.
Specifically, for what you're asking here, look at the view pg_stat_activity.
And no, the stats collector tracks everything.