##// END OF EJS Templates
fixed broken yui script during one of the merges
fixed broken yui script during one of the merges

File last commit:

r1228:73434499 default
r1235:d8561477 default
Show More
timerproxy.py
28 lines | 845 B | text/x-python | PythonLexer
renamed project to rhodecode
r547 from sqlalchemy.interfaces import ConnectionProxy
import time
merges for stable
r1228 import logging
log = logging.getLogger('timerproxy')
renamed project to rhodecode
r547 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
def color_sql(sql):
COLOR_SEQ = "\033[1;%dm"
COLOR_SQL = YELLOW
normal = '\x1b[0m'
merges for stable
r1228 return COLOR_SEQ % COLOR_SQL + sql + normal
renamed project to rhodecode
r547
class TimerProxy(ConnectionProxy):
merges for stable
r1228
renamed project to rhodecode
r547 def __init__(self):
super(TimerProxy, self).__init__()
merges for stable
r1228
def cursor_execute(self, execute, cursor, statement, parameters,
context, executemany):
renamed project to rhodecode
r547 now = time.time()
try:
merges for stable
r1228 log.info(color_sql(">>>>> STARTING QUERY >>>>>"))
renamed project to rhodecode
r547 return execute(cursor, statement, parameters, context)
finally:
total = time.time() - now
merges for stable
r1228 log.info(color_sql("<<<<< TOTAL TIME: %f <<<<<" % total))