Skip to content

Commit

Permalink
also update roundtripNanos prior to attemptEnded()
Browse files Browse the repository at this point in the history
  • Loading branch information
dapengzhang0 committed Nov 17, 2021
1 parent 32fdeef commit 5bc2b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion census/src/main/java/io/grpc/census/CensusStatsModule.java
Expand Up @@ -352,9 +352,9 @@ public void streamClosed(Status status) {
statusCode = Code.DEADLINE_EXCEEDED;
}
}
attemptsState.attemptEnded();
stopwatch.stop();
roundtripNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS);
attemptsState.attemptEnded();
if (inboundReceivedOrClosed.compareAndSet(false, true)) {
if (module.recordFinishedRpcs) {
// Stream is closed early. So no need to record metrics for any inbound events after this
Expand Down

0 comments on commit 5bc2b47

Please sign in to comment.