lessql
lessql copied to clipboard
Is it possible to get execution time of each queries
I log queries with setQueryCallback() nut we only have the queries, is it possible to get the query time execution?
perhaps in the $params argument?
Hm no, you can always wrap with your own timing functions to measure execution time of method calls on LessQL objects
To do this, one would:
- Add queryEndCallback in a subclass of LessQL\Database.
- Find usages of onQuery in LessQL\Database.
- Overrule those methods in the subclass.
https://gist.github.com/rubenvincenten/ef8aaa32a0e413592c8df74ba7ae910e
This should really be implemented in the v0 branch however, tagging it like v0.4? I'm assuming the next branch will be 1.x. I'll see about creating a pull request.
An alternative would be to use a subclass of PDO, like http://www.coderholic.com/php-database-query-logging-with-pdo/ Also, I found https://github.com/panique/pdo-debug to be an invaluable tool.
Something like the debug panel of Zebra Database would be amazing!