httppeer: report http statistics
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 01 Oct 2018 13:17:38 -0700
changeset 40035 393e44324037
parent 40034 5e5b06087ec5
child 40036 7a347d362a45
httppeer: report http statistics Now that keepalive.py records HTTP request count and the number of bytes sent and received as part of performing those requests, we can easily print a report on the activity when closing a peer instance! Exact byte counts are globbed in tests because they are influenced by non-deterministic things, such as hostnames and port numbers. Plus, the exact byte count isn't too important anyway. I feel obliged to note that printing the byte count could have security implications. e.g. if sending a password via HTTP basic auth, the length of that password will influence the byte count and the reporting of the byte count could be a side-channel leak of the password length. I /think/ this is beyond our threshold for concern. But if we think it poses a problem, we can teach the byte count logging code to e.g. ignore sensitive HTTP request headers. We could also consider not reporting the byte count of request headers altogether. But since the wire protocol uses HTTP headers for sending command arguments, it is kind of important to report their size. Differential Revision: https://phab.mercurial-scm.org/D4858
mercurial/httppeer.py
mercurial/url.py
tests/test-clone-uncompressed.t
tests/test-clonebundles.t
tests/test-http-api-httpv2.t
tests/test-http-protocol.t
tests/test-lfs-serve-access.t
tests/test-lfs-serve.t
tests/test-schemes.t
tests/test-stream-bundle-v2.t
tests/test-wireproto-caching.t
tests/test-wireproto-command-branchmap.t
tests/test-wireproto-command-capabilities.t
tests/test-wireproto-command-changesetdata.t
tests/test-wireproto-command-filedata.t
tests/test-wireproto-command-heads.t
tests/test-wireproto-command-known.t
tests/test-wireproto-command-listkeys.t
tests/test-wireproto-command-lookup.t
tests/test-wireproto-command-manifestdata.t
tests/test-wireproto-command-pushkey.t
tests/test-wireproto-content-redirects.t
tests/test-wireproto-exchangev2.t
--- a/mercurial/httppeer.py	Mon Oct 01 12:30:32 2018 -0700
+++ b/mercurial/httppeer.py	Mon Oct 01 13:17:38 2018 -0700
@@ -405,7 +405,11 @@
         return True
 
     def close(self):
-        pass
+        self.ui.note(_('(sent %d HTTP requests and %d bytes; '
+                       'received %d bytes in responses)\n') %
+                     (self._urlopener.requestscount,
+                      self._urlopener.sentbytescount,
+                      self._urlopener.receivedbytescount))
 
     # End of ipeerconnection interface.
 
@@ -758,7 +762,11 @@
         return False
 
     def close(self):
-        pass
+        self.ui.note(_('(sent %d HTTP requests and %d bytes; '
+                       'received %d bytes in responses)\n') %
+                     (self._opener.requestscount,
+                      self._opener.sentbytescount,
+                      self._opener.receivedbytescount))
 
     # End of ipeerconnection.
 
--- a/mercurial/url.py	Mon Oct 01 12:30:32 2018 -0700
+++ b/mercurial/url.py	Mon Oct 01 13:17:38 2018 -0700
@@ -555,6 +555,11 @@
     handlers.append(cookiehandler(ui))
     opener = urlreq.buildopener(*handlers)
 
+    # keepalive.py's handlers will populate these attributes if they exist.
+    opener.requestscount = 0
+    opener.sentbytescount = 0
+    opener.receivedbytescount = 0
+
     # The user agent should should *NOT* be used by servers for e.g.
     # protocol detection or feature negotiation: there are other
     # facilities for that.
--- a/tests/test-clone-uncompressed.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-clone-uncompressed.t	Mon Oct 01 13:17:38 2018 -0700
@@ -261,6 +261,7 @@
   bundle2-input-part: total payload size 24
   bundle2-input-bundle: 1 parts total
   checking for updated bookmarks
+  (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 #endif
 #if stream-bundle2
   $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
@@ -282,6 +283,7 @@
   bundle2-input-part: "listkeys" (params: 1 mandatory) supported
   bundle2-input-bundle: 1 parts total
   checking for updated bookmarks
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 #endif
 
 Cannot stream clone when there are secret changesets
--- a/tests/test-clonebundles.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-clonebundles.t	Mon Oct 01 13:17:38 2018 -0700
@@ -27,6 +27,7 @@
   adding file changes
   added 2 changesets with 2 changes to 2 files
   new changesets 53245c60e682:aaff8d2ffbbf
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat server/access.log
   * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
@@ -45,6 +46,7 @@
   adding file changes
   added 2 changesets with 2 changes to 2 files
   new changesets 53245c60e682:aaff8d2ffbbf
+  (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Manifest file with invalid URL aborts
 
--- a/tests/test-http-api-httpv2.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-http-api-httpv2.t	Mon Oct 01 13:17:38 2018 -0700
@@ -228,6 +228,7 @@
   response: gen[
     b'customreadonly bytes response'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Request to read-write command fails because server is read-only by default
 
--- a/tests/test-http-protocol.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-http-protocol.t	Mon Oct 01 13:17:38 2018 -0700
@@ -218,6 +218,7 @@
     b'namespaces': b'',
     b'phases': b''
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Same thing, but with "httprequest" command
 
@@ -286,6 +287,7 @@
   response: [
     b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ killdaemons.py
   $ enablehttpv2 empty
@@ -350,6 +352,7 @@
   response: [
     b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ killdaemons.py
 
@@ -483,6 +486,7 @@
   response: [
     b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
   ]
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ killdaemons.py
 
@@ -747,3 +751,4 @@
   response: [
     b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
   ]
+  (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
--- a/tests/test-lfs-serve-access.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-lfs-serve-access.t	Mon Oct 01 13:17:38 2018 -0700
@@ -140,6 +140,7 @@
   getting lfs.bin
   lfs: found f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e in the local lfs store
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
 
--- a/tests/test-lfs-serve.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-lfs-serve.t	Mon Oct 01 13:17:38 2018 -0700
@@ -362,6 +362,7 @@
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   updated to "d3b84d50eacb: lfs file with lfs client"
   1 other heads for branch "default"
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
   $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES
   $TESTTMP/client6_pull/.hg/requires:lfs
   $TESTTMP/server/.hg/requires:lfs
--- a/tests/test-schemes.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-schemes.t	Mon Oct 01 13:17:38 2018 -0700
@@ -42,6 +42,7 @@
   searching for changes
   all remote heads known locally
   no changes found
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
   [1]
 
 check that paths are expanded
--- a/tests/test-stream-bundle-v2.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-stream-bundle-v2.t	Mon Oct 01 13:17:38 2018 -0700
@@ -117,6 +117,7 @@
    E: remote created -> g
   getting E
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg clone --stream http://localhost:$HGPORT streamv2-clone-explicit --debug
   using http://localhost:$HGPORT/
@@ -172,3 +173,4 @@
    E: remote created -> g
   getting E
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
--- a/tests/test-wireproto-caching.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-caching.t	Mon Oct 01 13:17:38 2018 -0700
@@ -99,6 +99,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ sendhttpv2peer << EOF
   > command manifestdata
@@ -152,6 +153,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Sending different request doesn't yield cache hit.
 
@@ -214,6 +216,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat .hg/blackbox.log
   *> cacher constructed for manifestdata (glob)
@@ -292,6 +295,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ sendhttpv2peer << EOF
   > command manifestdata
@@ -345,6 +349,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat .hg/blackbox.log
   *> cacher constructed for manifestdata (glob)
@@ -596,6 +601,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ test -f .hg/blackbox.log
   [1]
--- a/tests/test-wireproto-command-branchmap.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-branchmap.t	Mon Oct 01 13:17:38 2018 -0700
@@ -88,5 +88,6 @@
       b'\xbe\x0e\xf7<\x17\xad\xe3\xfc\x89\xdcAp\x1e\xb9\xfc:\x91\xb5\x82\x82'
     ]
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-capabilities.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-capabilities.t	Mon Oct 01 13:17:38 2018 -0700
@@ -668,5 +668,6 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-changesetdata.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-changesetdata.t	Mon Oct 01 13:17:38 2018 -0700
@@ -196,6 +196,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Sending root nodes limits what data is sent
 
@@ -248,6 +249,7 @@
       b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting data on a single node by node works
 
@@ -297,6 +299,7 @@
       b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Specifying a noderange and nodes takes union
 
@@ -350,6 +353,7 @@
       b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 nodesdepth of 1 limits to exactly requested nodes
 
@@ -400,6 +404,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 nodesdepth of 2 limits to first ancestor
 
@@ -453,6 +458,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 nodesdepth with multiple nodes
 
@@ -512,6 +518,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Parents data is transferred upon request
 
@@ -566,6 +573,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Phase data is transferred upon request
 
@@ -617,6 +625,7 @@
       b'phase': b'public'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Revision data is transferred upon request
 
@@ -679,6 +688,7 @@
     },
     b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Bookmarks key isn't present if no bookmarks data
 
@@ -738,6 +748,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Bookmarks are sent when requested
 
@@ -808,6 +819,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Bookmarks are sent when we make a no-new-revisions request
 
@@ -896,6 +908,7 @@
       b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Multiple fields can be transferred
 
@@ -962,6 +975,7 @@
     },
     b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Base nodes have just their metadata (e.g. phase) transferred
 
@@ -1074,5 +1088,6 @@
     },
     b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-filedata.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-filedata.t	Mon Oct 01 13:17:38 2018 -0700
@@ -201,6 +201,7 @@
       b'node': b'\n\x862\x1f\x13y\xd1\xa9\xec\xd0W\x9a"\x97z\xf7\xa5\xac\xaf\x11'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting parents works
 
@@ -258,6 +259,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting revision data works
 (haveparents defaults to False, so fulltext is emitted)
@@ -322,6 +324,7 @@
     },
     b'a0\n00000000000000000000000000000000000000\n11111111111111111111111111111111111111\na1\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 haveparents=False should be same as above
 
@@ -386,6 +389,7 @@
     },
     b'a0\n00000000000000000000000000000000000000\n11111111111111111111111111111111111111\na1\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 haveparents=True should emit a delta
 
@@ -448,6 +452,7 @@
     },
     b'\x00\x00\x00Q\x00\x00\x00Q\x00\x00\x00\x03a1\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting multiple revisions works
 (first revision is a fulltext since haveparents=False by default)
@@ -523,6 +528,7 @@
     },
     b'\x00\x00\x00Q\x00\x00\x00Q\x00\x00\x00\x03a1\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Revisions are sorted by DAG order, parents first
 
@@ -597,6 +603,7 @@
     },
     b'\x00\x00\x00Q\x00\x00\x00Q\x00\x00\x00\x03a1\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting parents and revision data works
 
@@ -662,5 +669,6 @@
     },
     b'a0\n00000000000000000000000000000000000000\n11111111111111111111111111111111111111\na2\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-heads.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-heads.t	Mon Oct 01 13:17:38 2018 -0700
@@ -72,6 +72,7 @@
     b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^',
     b')Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting just the public heads works
 
@@ -116,5 +117,6 @@
   response: [
     b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-known.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-known.t	Mon Oct 01 13:17:38 2018 -0700
@@ -60,6 +60,7 @@
   s>     \r\n
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   response: []
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Single known node works
 
@@ -104,6 +105,7 @@
   response: [
     True
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Multiple nodes works
 
@@ -150,5 +152,6 @@
     False,
     True
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-listkeys.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-listkeys.t	Mon Oct 01 13:17:38 2018 -0700
@@ -68,6 +68,7 @@
     b'namespaces': b'',
     b'phases': b''
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Request for phases works
 
@@ -113,6 +114,7 @@
     b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1',
     b'publishing': b'True'
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Request for bookmarks works
 
@@ -157,5 +159,6 @@
   response: {
     b'@': b'26805aba1e600a82e93661149f2313866a221a7b'
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-lookup.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-lookup.t	Mon Oct 01 13:17:38 2018 -0700
@@ -60,5 +60,6 @@
   s>     \r\n
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0'
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-manifestdata.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-manifestdata.t	Mon Oct 01 13:17:38 2018 -0700
@@ -191,6 +191,7 @@
       b'node': b'F\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0'
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting parents works
 
@@ -246,6 +247,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting revision data works
 (haveparents defaults to false, so fulltext is emitted)
@@ -310,6 +312,7 @@
     },
     b'a\x000879345e39377229634b420c639454156726c6b6\nb\x00819e258d31a5e1606629f365bb902a1b21ee4216\ndir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\ndir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\ndir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\ndir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 haveparents=False yields same output
 
@@ -374,6 +377,7 @@
     },
     b'a\x000879345e39377229634b420c639454156726c6b6\nb\x00819e258d31a5e1606629f365bb902a1b21ee4216\ndir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\ndir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\ndir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\ndir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 haveparents=True will emit delta
 
@@ -434,6 +438,7 @@
     },
     b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting multiple revisions works
 (haveparents defaults to false, so fulltext is emitted unless a parent
@@ -511,6 +516,7 @@
     },
     b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 With haveparents=True, first revision is a delta instead of fulltext
 
@@ -587,6 +593,7 @@
     },
     b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Revisions are sorted by DAG order, parents first
 
@@ -662,6 +669,7 @@
     },
     b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Requesting parents and revision data works
 
@@ -745,5 +753,6 @@
     },
     b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n'
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-command-pushkey.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-command-pushkey.t	Mon Oct 01 13:17:38 2018 -0700
@@ -63,6 +63,7 @@
   s>     \r\n
   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
   response: True
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ sendhttpv2peer << EOF
   > command listkeys
@@ -105,5 +106,6 @@
   response: {
     b'@': b'426bada5c67598ca65036d57d9e4b64b0c1ce7a0'
   }
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
--- a/tests/test-wireproto-content-redirects.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-content-redirects.t	Mon Oct 01 13:17:38 2018 -0700
@@ -317,6 +317,7 @@
       }
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Unknown protocol is filtered from compatible targets
 
@@ -610,6 +611,7 @@
       }
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Missing SNI support filters targets that require SNI
 
@@ -901,6 +903,7 @@
       }
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat >> $HGRCPATH << EOF
   > [extensions]
@@ -1191,6 +1194,7 @@
       }
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Set up the server to issue content redirects to its built-in API server.
 
@@ -1279,6 +1283,7 @@
       ]
     }
   ]
+  (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 Cached entry should be available on server
 
@@ -1381,6 +1386,7 @@
       ]
     }
   ]
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cat error.log
   $ killdaemons.py
--- a/tests/test-wireproto-exchangev2.t	Mon Oct 01 12:30:32 2018 -0700
+++ b/tests/test-wireproto-exchangev2.t	Mon Oct 01 13:17:38 2018 -0700
@@ -130,6 +130,7 @@
   received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
   updating the branch cache
   new changesets 3390ef850073:caa2a465451d (3 drafts)
+  (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 
 All changesets should have been transferred
 
@@ -256,6 +257,7 @@
   received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
   updating the branch cache
   new changesets 3390ef850073:4432d83626e8
+  (sent 6 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ cd client-singlehead
 
@@ -369,6 +371,7 @@
   updating the branch cache
   new changesets cd2534766bec:caa2a465451d (3 drafts)
   (run 'hg update' to get a working copy)
+  (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg log -G -T '{rev} {node} {phase}\n'
   o  4 caa2a465451dd1facda0f5b12312c355584188a1 draft
@@ -439,6 +442,7 @@
   checking for updated bookmarks
   2 local changesets published
   (run 'hg update' to get a working copy)
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg log -G -T '{rev} {node} {phase}\n'
   o  4 caa2a465451dd1facda0f5b12312c355584188a1 public
@@ -555,6 +559,7 @@
   received frame(size=0; request=3; stream=2; streamflags=; type=command-response; flags=eos)
   updating the branch cache
   new changesets 3390ef850073:caa2a465451d (1 drafts)
+  (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg -R client-bookmarks bookmarks
      book-1                    0:3390ef850073
@@ -611,6 +616,7 @@
   checking for updated bookmarks
   updating bookmark book-1
   (run 'hg update' to get a working copy)
+  (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
 
   $ hg -R client-bookmarks bookmarks
      book-1                    2:cd2534766bec