fetch-pack: add tracing for negotiation rounds
commita29263cf5f419fb3095d01bcf8e806d12dd7ec71
authorJosh Steadmon <steadmon@google.com>
Tue, 2 Aug 2022 22:04:05 +0000 (2 15:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Aug 2022 16:17:03 +0000 (15 09:17 -0700)
tree87db403f6263eb9c429c40a797e604aa2a5a5857
parentafa70145a25e81faa685dc0b465e52b45d2444bd
fetch-pack: add tracing for negotiation rounds

Currently, negotiation for V0/V1/V2 fetch have trace2 regions covering
the entire negotiation process. However, we'd like additional data, such
as timing for each round of negotiation or the number of "haves" in each
round. Additionally, "independent negotiation" (AKA push negotiation)
has no tracing at all. Having this data would allow us to compare the
performance of the various negotation implementations, and to debug
unexpectedly slow fetch & push sessions.

Add per-round trace2 regions for all negotiation implementations (V0+V1,
V2, and independent negotiation), as well as an overall region for
independent negotiation. Add trace2 data logging for the number of haves
and "in vain" objects for each round, and for the total number of rounds
once negotiation completes.  Finally, add a few checks into various
tests to verify that the number of rounds is logged as expected.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fetch-pack.c
t/t5500-fetch-pack.sh
t/t5516-fetch-push.sh
t/t5601-clone.sh
t/t5703-upload-pack-ref-in-want.sh