Rev 4465: Add some more 'number of bytes' debugging to '-Dhpss' in http://bazaar.launchpad.net/~jameinel/bzr/1.17-extra-hpss-debug

John Arbash Meinel john at arbash-meinel.com
Fri Jun 19 17:41:15 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/1.17-extra-hpss-debug

------------------------------------------------------------
revno: 4465
revision-id: john at arbash-meinel.com-20090619164050-sb1e5fs4qngwnibr
parent: pqm at pqm.ubuntu.com-20090619110117-rhph89w2k9gavp24
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.17-extra-hpss-debug
timestamp: Fri 2009-06-19 11:40:50 -0500
message:
  Add some more 'number of bytes' debugging to '-Dhpss'
-------------- next part --------------
=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/smart/medium.py	2009-06-19 16:40:50 +0000
@@ -387,6 +387,9 @@
         """
         if self._state != "writing":
             raise errors.WritingCompleted(self)
+        if 'hpss' in debug.debug_flags:
+            trace.mutter('medium request %s accepted %d bytes',
+                         self.__class__.__name__, len(bytes))
         self._accept_bytes(bytes)
 
     def _accept_bytes(self, bytes):
@@ -669,6 +672,9 @@
         self._current_request = None
 
     def accept_bytes(self, bytes):
+        if 'hpss' in debug.debug_flags:
+            trace.mutter('medium %s accepted %d bytes',
+                         self.__class__.__name__, len(bytes))
         self._accept_bytes(bytes)
 
     def __del__(self):

=== modified file 'bzrlib/smart/protocol.py'
--- a/bzrlib/smart/protocol.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/smart/protocol.py	2009-06-19 16:40:50 +0000
@@ -26,7 +26,7 @@
 
 import bzrlib
 from bzrlib import debug
-from bzrlib import errors
+from bzrlib import errors, trace
 from bzrlib.smart import message, request
 from bzrlib.trace import log_exception_quietly, mutter
 from bzrlib.bencode import bdecode_as_tuple, bencode
@@ -130,6 +130,9 @@
 
         :param bytes: must be a byte string
         """
+        if 'hpss' in debug.debug_flags:
+            trace.mutter('request %s accepted %d bytes',
+                         self.__class__.__name__, len(bytes))
         if not isinstance(bytes, str):
             raise ValueError(bytes)
         self.in_buffer += bytes
@@ -376,6 +379,9 @@
         finished_reading will be set when no more data is required.  Further
         data will be appended to self.unused_data.
         """
+        if 'hpss' in debug.debug_flags:
+            trace.mutter('decoder %s accepted %d bytes',
+                         self.__class__.__name__, len(bytes))
         # accept_bytes is allowed to change the state
         self._number_needed_bytes = None
         # lsprof puts a very large amount of time on this specific call for
@@ -888,6 +894,7 @@
         self.request_handler = self.message_handler = message_handler
 
     def accept_bytes(self, bytes):
+        # accept_bytes is logged in _StatefulDecoder.accept_bytes
         self._number_needed_bytes = None
         try:
             _StatefulDecoder.accept_bytes(self, bytes)

=== modified file 'bzrlib/smart/request.py'
--- a/bzrlib/smart/request.py	2009-06-15 06:47:14 +0000
+++ b/bzrlib/smart/request.py	2009-06-19 16:40:50 +0000
@@ -281,6 +281,9 @@
 
     def accept_body(self, bytes):
         """Accept body data."""
+        if 'hpss' in debug.debug_flags:
+            trace.mutter('request %s accepted %d body bytes',
+                         self.__class__.__name__, len(bytes))
         self._run_handler_code(self._command.do_chunk, (bytes,), {})
 
     def end_of_body(self):



More information about the bazaar-commits mailing list