13 global PROFILER_ENABLED
15 PROFILER_START = time.time()
21 global PROFILER_ENABLED
30 for p
in PROFILER_DATA:
31 hdf.setValue(
"%s.%d.when" % (prefix, n),
"%5.2f" % (p.when))
32 hdf.setValue(
"%s.%d.time" % (prefix, n),
"%5.2f" % (p.length))
33 hdf.setValue(
"%s.%d.klass" % (prefix, n), p.klass)
34 hdf.setValue(
"%s.%d.what" % (prefix, n),
" " * p.depth + p.what)
35 hdf.setValue(
"%s.%d.where" % (prefix, n), neo_cgi.htmlEscape(p.where))
40 global PROFILER_ENABLED
43 if not PROFILER_ENABLED:
return 44 self.
when = time.time() - PROFILER_START
46 self.
where = who_calls.pretty_who_calls()
50 PROFILER_DEPTH = PROFILER_DEPTH + 1
52 PROFILER_DATA.append(self)
55 global PROFILER_ENABLED
57 if not PROFILER_ENABLED:
return 58 self.
length = time.time() - self.
when - PROFILER_START
59 PROFILER_DEPTH = PROFILER_DEPTH - 1
60 if PROFILER_DEPTH < 0: PROFILER_DEPTH = 0
68 r = self.real_cursor.execute(query, args)
def execute(self, query, args=None)
def __init__(self, real_cursor)
def hdfExport(prefix, hdf)
def __getattr__(self, key)
def __init__(self, klass, what)