Commit ce4ac7b4 authored by Tim Peters's avatar Tim Peters

Restore connectionDebugInfo().

This can't use self._connectionMap, because it needs to
know the version associated with each connection.
parent 4225926d
...@@ -562,23 +562,22 @@ class DB(object): ...@@ -562,23 +562,22 @@ class DB(object):
def connectionDebugInfo(self): def connectionDebugInfo(self):
result = [] result = []
t = time() t = time()
def f(c): for version, pool in self._pools.items():
o = c._opened for c in pool.all_as_list():
d = c._debug_info o = c._opened
if d: d = c._debug_info
if len(d) == 1: if d:
d = d[0] if len(d) == 1:
else: d = d[0]
d = '' else:
d = "%s (%s)" % (d, len(c._cache)) d = ''
d = "%s (%s)" % (d, len(c._cache))
result.append({
'opened': o and ("%s (%.2fs)" % (ctime(o), t-o)),
'info': d,
'version': version,
})
self._connectionMap(f) result.append({
'opened': o and ("%s (%.2fs)" % (ctime(o), t-o)),
'info': d,
'version': version,
})
return result return result
def getActivityMonitor(self): def getActivityMonitor(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment