Patchwork [2,of,2,(minor,debug,output,change)] listkey: display the size of the listkey payload in a debug message

login
register
mail settings
Submitter Pierre-Yves David
Date May 29, 2015, 7:22 a.m.
Message ID <b6fd34a04aafe31da3e3.1432884172@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9355/
State Accepted
Headers show

Comments

Pierre-Yves David - May 29, 2015, 7:22 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1432882159 25200
#      Thu May 28 23:49:19 2015 -0700
# Node ID b6fd34a04aafe31da3e365af71e83b86425cf43a
# Parent  ecb37d01e8e622d29daef4df1fccda9d85c521aa
listkey: display the size of the listkey payload in a debug message

This is a useful information to have in general and we already have debug
output related to listkeys. I'm planning to play around with massive amount of
phases roots and bookmarks so having this data in debug will be very useful.
This already got me to spot that one of the Logilab's review repo is exchanging
65KB of phases data during each exchanges.
Augie Fackler - May 29, 2015, 2:37 p.m.
On Fri, May 29, 2015 at 12:22:52AM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1432882159 25200
> #      Thu May 28 23:49:19 2015 -0700
> # Node ID b6fd34a04aafe31da3e365af71e83b86425cf43a
> # Parent  ecb37d01e8e622d29daef4df1fccda9d85c521aa
> listkey: display the size of the listkey payload in a debug message

Queued, thanks.

You may have set a new record for "number of consecutive
debug-message-only patches reviewed by Augie".

>
> This is a useful information to have in general and we already have debug
> output related to listkeys. I'm planning to play around with massive amount of
> phases roots and bookmarks so having this data in debug will be very useful.
> This already got me to spot that one of the Logilab's review repo is exchanging
> 65KB of phases data during each exchanges.
>
> diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
> --- a/mercurial/wireproto.py
> +++ b/mercurial/wireproto.py
> @@ -322,10 +322,12 @@ class wirepeer(peer.peerrepository):
>              yield {}, None
>          f = future()
>          self.ui.debug('preparing listkeys for "%s"\n' % namespace)
>          yield {'namespace': encoding.fromlocal(namespace)}, f
>          d = f.value
> +        self.ui.debug('received listkey for "%s": %i bytes\n'
> +                      % (namespace, len(d)))
>          yield pushkeymod.decodekeys(d)
>
>      def stream_out(self):
>          return self._callstream('stream_out')
>
> diff --git a/tests/test-ssh.t b/tests/test-ssh.t
> --- a/tests/test-ssh.t
> +++ b/tests/test-ssh.t
> @@ -455,19 +455,22 @@ debug output
>    remote: 271
>    remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
>    remote: 1
>    preparing listkeys for "bookmarks"
>    sending listkeys command
> +  received listkey for "bookmarks": 45 bytes
>    preparing listkeys for "bookmarks"
>    sending listkeys command
> +  received listkey for "bookmarks": 45 bytes
>    query 1; heads
>    sending batch command
>    searching for changes
>    all remote heads known locally
>    no changes found
>    preparing listkeys for "phases"
>    sending listkeys command
> +  received listkey for "phases": 15 bytes
>    checking for updated bookmarks
>
>    $ cd ..
>
>    $ cat dummylog
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -322,10 +322,12 @@  class wirepeer(peer.peerrepository):
             yield {}, None
         f = future()
         self.ui.debug('preparing listkeys for "%s"\n' % namespace)
         yield {'namespace': encoding.fromlocal(namespace)}, f
         d = f.value
+        self.ui.debug('received listkey for "%s": %i bytes\n'
+                      % (namespace, len(d)))
         yield pushkeymod.decodekeys(d)
 
     def stream_out(self):
         return self._callstream('stream_out')
 
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -455,19 +455,22 @@  debug output
   remote: 271
   remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
   remote: 1
   preparing listkeys for "bookmarks"
   sending listkeys command
+  received listkey for "bookmarks": 45 bytes
   preparing listkeys for "bookmarks"
   sending listkeys command
+  received listkey for "bookmarks": 45 bytes
   query 1; heads
   sending batch command
   searching for changes
   all remote heads known locally
   no changes found
   preparing listkeys for "phases"
   sending listkeys command
+  received listkey for "phases": 15 bytes
   checking for updated bookmarks
 
   $ cd ..
 
   $ cat dummylog