##// END OF EJS Templates
Implemented paging to admin user acion log
Implemented paging to admin user acion log

File last commit:

r49:3ada2f40 default
r78:6f524697 default
Show More
timerproxy.py
15 lines | 569 B | text/x-python | PythonLexer
Marcin Kuzminski
Added sqlalchemy support...
r49 from sqlalchemy.interfaces import ConnectionProxy
import time
import logging
log = logging.getLogger(__name__)
class TimerProxy(ConnectionProxy):
def cursor_execute(self, execute, cursor, statement, parameters, context, executemany):
now = time.time()
try:
log.info(">>>>> STARTING QUERY >>>>>")
return execute(cursor, statement, parameters, context)
finally:
total = time.time() - now
log.info("Query: %s" % statement % parameters)
log.info("<<<<< TOTAL TIME: %f <<<<<" % total)