Hi, 

In an effort to find the bottlenecks in our system we'd like to collect 
statistics about which queries take a long time, or return a lot of rows, 
or paths which are triggering lots of queries.

Now, the system consists of lots of parts working in parallel, each with 
their own Session object, so we want the stats per Session.

The obvious way to do this seems to be by using the events subsystem, 
hooking into the before/after_execute events on a Connection. but the 
problem here is that you only have the Connection object, but no idea which 
Session it belongs to.

Is there any way to extract this information reliably? There is the 
after_begin() event on a Session which has both the Session and the 
Connection, but there doesn't appear to be a reliable moment when the 
Session is no longer related to a connection. Or am I missing something?

Thanks in advance,

-- 
Martijn van Oosterhout <klep...@gmail.com> http://svana.org/kleptog/

-- 
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.

Reply via email to