Skip to content

Commit

Permalink
fix: only record retry count when it's > 0 (#1488)
Browse files Browse the repository at this point in the history
* fix: only record retry count when it's > 0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
mutianf and gcf-owl-bot[bot] authored Nov 1, 2022
1 parent e67ac61 commit 445a667
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ private void recordOperationCompletion(@Nullable Throwable status) {
operationTimer.stop();
long operationLatency = operationTimer.elapsed(TimeUnit.MILLISECONDS);

recorder.putRetryCount(attemptCount - 1);
// Only record when retry count is greater than 0 so the retry
// graph will be less confusing
if (attemptCount > 1) {
recorder.putRetryCount(attemptCount - 1);
}

// serverLatencyTimer should already be stopped in recordAttemptCompletion
recorder.putOperationLatencies(operationLatency);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class BuiltinMetricsIT {

public static String[] VIEWS = {
"operation_latencies",
"retry_count",
"attempt_latencies",
"connectivity_error_count",
"application_blocking_latencies"
Expand Down

0 comments on commit 445a667

Please sign in to comment.