1

Is there a way to get the stack trace for each sql query using the db profiler?

I'm using the profiler like so:

foreach($profiler->getQueryProfiles() as $query) {

}

Which is fine as I can get elapsed seconds, actual query etc but I want to know where this query was called from so I need the last 3 or 4 items in the stack trace.

Any ideas?

1 Answer 1

4

Extend Zend_Db_Profiler and use debug_backtrace() in the queryEnd method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.