Hi! Because the SQLAlchemy ORM by default lazy-loads relationships, I've found that the greatest performance issues are caused by burgeoning query counts. In order to try and keep on top of this, I've decided to count and log the number of queries per request in my web application.
I wrote up a simple query counter which seems to work, but I'm a bit nervous I've made a mistake, especially in my assumptions on how sessions and connections relate. Can you take a peek and let me know how it looks? https://gist.github.com/luhn/96cd88fe69e65b75166d07e6a6f42923 -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.