pullbundle: add an output about the time spent slicing the set
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 23 Sep 2018 22:58:11 +0200
changeset 4133 1293625d274d
parent 4132 afc933d32085
child 4134 ab77f37fedf3
pullbundle: add an output about the time spent slicing the set This will be useful to monitor overall performance.
hgext3rd/pullbundle.py
tests/test-pullbundle.t
--- a/hgext3rd/pullbundle.py	Sun Sep 23 22:45:23 2018 +0200
+++ b/hgext3rd/pullbundle.py	Sun Sep 23 22:58:11 2018 +0200
@@ -131,7 +131,13 @@
         makeonecgpart(newpart, repo, None, outgoing, version, source, bundlecaps,
                       filematcher, cgversions)
     else:
-        for sliceid, sliceout in sliceoutgoing(repo, outgoing):
+        start = util.timer()
+        slices = sliceoutgoing(repo, outgoing)
+        end = util.timer()
+        msg = _('pullbundle-cache: "missing" set sliced into %d subranges '
+                'in %s seconds\n')
+        repo.ui.write(msg % (len(slices), end - start))
+        for sliceid, sliceout in slices:
             makeonecgpart(newpart, repo, sliceid, sliceout, version, source, bundlecaps,
                           filematcher, cgversions)
 
--- a/tests/test-pullbundle.t	Sun Sep 23 22:45:23 2018 +0200
+++ b/tests/test-pullbundle.t	Sun Sep 23 22:58:11 2018 +0200
@@ -32,6 +32,7 @@
   $ hg -R client pull server -r 1234 --debug --config devel.bundle2.debug=yes | grep -v 'add changeset'
   pulling from server
   query 1; heads
+  pullbundle-cache: "missing" set sliced into 6 subranges in *.* seconds (glob)
   1024 changesets found
   128 changesets found
   64 changesets found
@@ -257,6 +258,7 @@
   query 1; heads
   searching for changes
   all local heads known remotely
+  pullbundle-cache: "missing" set sliced into 16 subranges in *.* seconds (glob)
   16 changesets found
   29 changesets found
   256 changesets found
@@ -684,6 +686,7 @@
   $ hg -R client2 pull server -r 1234 --debug --config devel.bundle2.debug=yes --traceback| grep -v 'add changeset'
   pulling from server
   query 1; heads
+  pullbundle-cache: "missing" set sliced into 6 subranges in *.* seconds (glob)
   1024 changesets found in caches
   128 changesets found in caches
   64 changesets found in caches
@@ -897,6 +900,7 @@
   query 1; heads
   searching for changes
   all local heads known remotely
+  pullbundle-cache: "missing" set sliced into 16 subranges in *.* seconds (glob)
   16 changesets found in caches
   29 changesets found in caches
   256 changesets found in caches
@@ -1305,6 +1309,7 @@
   $ hg -R client3 pull server -r 1789 --debug --config devel.bundle2.debug=yes | grep -v 'add changeset'
   pulling from server
   query 1; heads
+  pullbundle-cache: "missing" set sliced into 9 subranges in *.* seconds (glob)
   1024 changesets found in caches
   227 changesets found
   29 changesets found in caches
@@ -1607,6 +1612,7 @@
   query 1; heads
   searching for changes
   all local heads known remotely
+  pullbundle-cache: "missing" set sliced into 16 subranges in *.* seconds (glob)
   1 changesets found
   4 changesets found
   8 changesets found
@@ -2025,6 +2031,7 @@
   $ hg -R client4 pull --verbose server | grep -v 'add changeset'
   pulling from server
   requesting all changes
+  pullbundle-cache: "missing" set sliced into 15 subranges in *.* seconds (glob)
   1024 changesets found in caches
   512 changesets found
   256 changesets found in caches