Merge "UploadPack: Record negotiation stats on fetchV2 call"
This commit is contained in:
commit
c40683929c
|
@ -1189,6 +1189,7 @@ private void fetchV2(PacketLineOut pckOut) throws IOException {
|
||||||
|
|
||||||
PackStatistics.Accumulator accumulator = new PackStatistics.Accumulator();
|
PackStatistics.Accumulator accumulator = new PackStatistics.Accumulator();
|
||||||
Instant negotiateStart = Instant.now();
|
Instant negotiateStart = Instant.now();
|
||||||
|
accumulator.advertised = advertised.size();
|
||||||
|
|
||||||
ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig);
|
ProtocolV2Parser parser = new ProtocolV2Parser(transferConfig);
|
||||||
FetchV2Request req = parser.parseFetchRequest(pckIn);
|
FetchV2Request req = parser.parseFetchRequest(pckIn);
|
||||||
|
@ -1209,6 +1210,7 @@ private void fetchV2(PacketLineOut pckOut) throws IOException {
|
||||||
// TODO(ifrade): Avoid mutating the parsed request.
|
// TODO(ifrade): Avoid mutating the parsed request.
|
||||||
req.getWantIds().addAll(wantedRefs.values());
|
req.getWantIds().addAll(wantedRefs.values());
|
||||||
wantIds = req.getWantIds();
|
wantIds = req.getWantIds();
|
||||||
|
accumulator.wants = wantIds.size();
|
||||||
|
|
||||||
boolean sectionSent = false;
|
boolean sectionSent = false;
|
||||||
boolean mayHaveShallow = req.getDepth() != 0
|
boolean mayHaveShallow = req.getDepth() != 0
|
||||||
|
@ -1766,7 +1768,6 @@ private boolean negotiate(FetchRequest req,
|
||||||
&& line.length() == PACKET_HAVE.length() + 40) {
|
&& line.length() == PACKET_HAVE.length() + 40) {
|
||||||
peerHas.add(ObjectId
|
peerHas.add(ObjectId
|
||||||
.fromString(line.substring(PACKET_HAVE.length())));
|
.fromString(line.substring(PACKET_HAVE.length())));
|
||||||
accumulator.haves++;
|
|
||||||
} else if (line.equals(PACKET_DONE)) {
|
} else if (line.equals(PACKET_DONE)) {
|
||||||
last = processHaveLines(peerHas, last, pckOut, accumulator, Option.NONE);
|
last = processHaveLines(peerHas, last, pckOut, accumulator, Option.NONE);
|
||||||
|
|
||||||
|
@ -1798,6 +1799,7 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last,
|
||||||
parseWants(accumulator);
|
parseWants(accumulator);
|
||||||
if (peerHas.isEmpty())
|
if (peerHas.isEmpty())
|
||||||
return last;
|
return last;
|
||||||
|
accumulator.haves += peerHas.size();
|
||||||
|
|
||||||
sentReady = false;
|
sentReady = false;
|
||||||
int haveCnt = 0;
|
int haveCnt = 0;
|
||||||
|
|
Loading…
Reference in New Issue