Rev 4894: Review feedback from Andrew. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-Dhpss-server
John Arbash Meinel
john at arbash-meinel.com
Mon Dec 14 16:16:07 GMT 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1-Dhpss-server
------------------------------------------------------------
revno: 4894
revision-id: john at arbash-meinel.com-20091214161605-ifvx2fwd2b7rlvsf
parent: john at arbash-meinel.com-20091211221431-1lvz9njzb7v2qpwg
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-Dhpss-server
timestamp: Mon 2009-12-14 10:16:05 -0600
message:
Review feedback from Andrew.
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2009-12-11 21:45:27 +0000
+++ b/bzrlib/osutils.py 2009-12-14 16:16:05 +0000
@@ -71,6 +71,11 @@
from bzrlib import symbol_versioning
+# Cross platform wall-clock time functionality with decent resolution.
+# On Linux ``time.clock`` returns only CPU time. On Windows, ``time.time()``
+# only has a resolution of ~15ms. Note that ``time.clock()`` is not
+# synchronized with ``time.time()``, this is only meant to be used to find
+# delta times by subtracting from another call to this function.
timer_func = time.time
if sys.platform == 'win32':
timer_func = time.clock
=== modified file 'bzrlib/smart/protocol.py'
--- a/bzrlib/smart/protocol.py 2009-12-11 22:14:31 +0000
+++ b/bzrlib/smart/protocol.py 2009-12-14 16:16:05 +0000
@@ -1143,7 +1143,7 @@
self.response_sent = False
self._headers = {'Software version': bzrlib.__version__}
if 'hpss' in debug.debug_flags:
- self._thread_id = threading.currentThread().ident
+ self._thread_id = threading.currentThread().get_ident()
self._response_start_time = None
def _trace(self, action, message, extra_bytes=None, include_time=False):
@@ -1286,7 +1286,6 @@
def call(self, *args):
if 'hpss' in debug.debug_flags:
- import pdb; pdb.set_trace()
mutter('hpss call: %s', repr(args)[1:-1])
base = getattr(self._medium_request._medium, 'base', None)
if base is not None:
=== modified file 'bzrlib/smart/request.py'
--- a/bzrlib/smart/request.py 2009-12-11 22:14:31 +0000
+++ b/bzrlib/smart/request.py 2009-12-14 16:16:05 +0000
@@ -291,7 +291,7 @@
self._command = None
if 'hpss' in debug.debug_flags:
self._request_start_time = osutils.timer_func()
- self._thread_id = threading.currentThread().ident
+ self._thread_id = threading.currentThread().get_ident()
def _trace(self, action, message, extra_bytes=None, include_time=False):
# It is a bit of a shame that this functionality overlaps with that of
More information about the bazaar-commits
mailing list