How could I check the number of active sqlalchemy connections in a pool at any given time?

主宰稳场 提交于 2019-12-05 07:02:59

The default QueuePool has a status method that returns the following:

def status(self):
        return "Pool size: %d  Connections in pool: %d "\
            "Current Overflow: %d Current Checked out "\
            "connections: %d" % (self.size(),
                                 self.checkedin(),
                                 self.overflow(),
                                 self.checkedout())

Pool.checkedout() will return the number of checked out connections.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!