diff options
author | Terry Parker <tparker@google.com> | 2020-09-22 11:34:24 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2020-09-22 11:34:24 -0400 |
commit | be403859c1a38f588cf87f2adf06e8d0813aa832 (patch) | |
tree | d1cef79760cfecc7723ef08b19f8fecc96db21ac | |
parent | cb553e3583aec02336edd1d4115ac8a14537a475 (diff) | |
parent | c3458a6e03707c0e45cd6354d1e6f0aebadf234e (diff) | |
download | jgit-be403859c1a38f588cf87f2adf06e8d0813aa832.tar.gz jgit-be403859c1a38f588cf87f2adf06e8d0813aa832.zip |
Merge "Measure time taken for negotiation in protocol V2"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 9889015261..8c243d439b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1137,6 +1137,9 @@ public class UploadPack { advertised = refIdSet(getAdvertisedOrDefaultRefs().values()); } + PackStatistics.Accumulator accumulator = new PackStatistics.Accumulator(); + long negotiateStart = System.currentTimeMillis(); + ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig); FetchV2Request req = parser.parseFetchRequest(pckIn); currentRequest = req; @@ -1238,7 +1241,11 @@ public class UploadPack { // But sideband-all is not used, so we have to write it ourselves. pckOut.writeString("packfile\n"); //$NON-NLS-1$ } - sendPack(new PackStatistics.Accumulator(), + + accumulator.timeNegotiating = System.currentTimeMillis() + - negotiateStart; + + sendPack(accumulator, req, req.getClientCapabilities().contains(OPTION_INCLUDE_TAG) ? db.getRefDatabase().getRefsByPrefix(R_TAGS) |