10000 Use separate id generator; rename attribute name. · Geisirc/google-http-java-client@86bc0ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 86bc0ae

Browse files
HailongWenmattwhisenhunt
authored andcommitted
Use separate id generator; rename attribute name.
1 parent f26d9da commit 86bc0ae

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,14 +869,15 @@ public HttpResponse execute() throws IOException {
869869
.spanBuilder(OpenCensusUtils.SPAN_NAME_HTTP_REQUEST_EXECUTE)
870870
.setRecordEvents(OpenCensusUtils.isRecordEvent())
871871
.startSpan();
872-
long idGenerator = 0L;
872+
long sentIdGenerator = 0L;
873+
long recvIdGenerator = 0L;
873874

874875
do {
875876
span.addAnnotation(
876877
Annotation.fromDescriptionAndAttributes(
877878
"retry",
878879
Collections.<String, AttributeValue>singletonMap(
879-
"number of retry",
880+
"number",
880881
AttributeValue.longAttributeValue(numRetries - retriesRemaining))));
881882
// Cleanup any unneeded response from a previous iteration
882883
if (response != null) {
@@ -1005,12 +1006,12 @@ public HttpResponse execute() throws IOException {
10051006
// switch tracing scope to current span
10061007
Scope ws = tracer.withSpan(span);
10071008
OpenCensusUtils.recordSentMessageEvent(
1008-
span, idGenerator++, lowLevelHttpRequest.getContentLength());
1009+
span, sentIdGenerator++, lowLevelHttpRequest.getContentLength());
10091010
try {
10101011
LowLevelHttpResponse lowLevelHttpResponse = lowLevelHttpRequest.execute();
10111012
if (lowLevelHttpResponse != null) {
10121013
OpenCensusUtils.recordReceivedMessageEvent(
1013-
span, idGenerator++, lowLevelHttpResponse.getContentLength());
1014+
span, recvIdGenerator++, lowLevelHttpResponse.getContentLength());
10141015
}
10151016
// Flag used to indicate if an exception is thrown before the response is constructed.
10161017
boolean responseConstructed = false;

0 commit comments

Comments
 (0)
0