Commit cfccb5da authored by Jim Fulton's avatar Jim Fulton

Added duration to connection debugging info.

parent 573a3dd4
...@@ -84,15 +84,15 @@ ...@@ -84,15 +84,15 @@
############################################################################## ##############################################################################
"""Database objects """Database objects
$Id: DB.py,v 1.14 1999/08/25 17:36:02 jim Exp $""" $Id: DB.py,v 1.15 1999/08/26 20:24:12 jim Exp $"""
__version__='$Revision: 1.14 $'[11:-2] __version__='$Revision: 1.15 $'[11:-2]
import cPickle, cStringIO, sys, POSException import cPickle, cStringIO, sys, POSException
from Connection import Connection from Connection import Connection
from bpthread import allocate_lock from bpthread import allocate_lock
from Transaction import Transaction from Transaction import Transaction
from referencesf import referencesf from referencesf import referencesf
from time import ctime from time import time, ctime
StringType=type('') StringType=type('')
...@@ -493,10 +493,12 @@ class DB: ...@@ -493,10 +493,12 @@ class DB:
def connectionDebugInfo(self): def connectionDebugInfo(self):
r=[] r=[]
pools,pooll=self._pools pools,pooll=self._pools
t=time()
for version, (pool, allocated, lock) in pools.items(): for version, (pool, allocated, lock) in pools.items():
for c in allocated: for c in allocated:
o=c._opened
r.append({ r.append({
'opened': c._opened and ctime(c._opened), 'opened': o and ("%s (%.2fs)" % (ctime(o), t-o)),
'info': c._debug_info, 'info': c._debug_info,
'version': version, 'version': version,
}) })
......
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