diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java index 2dc57b1a1cb612..7decb9357a6934 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java @@ -223,6 +223,7 @@ public SpawnResult run() // subprocess, so let them bubble up on first occurrence. In particular, we need this to // be true for InterruptedException to ensure that the dynamic scheduler can stop us // quickly. + Stopwatch rertyStopwatch = Stopwatch.createStarted(); SpawnResult result = runOnce(); if (attempts == localExecutionOptions.localRetriesOnCrash || !TerminationStatus.crashed(result.exitCode())) { @@ -234,6 +235,7 @@ public SpawnResult run() result.exitCode(), attempts); Thread.sleep(attempts * 1000); + spawnMetrics.addRetryTime(result.exitCode(), rertyStopwatch.elapsed()); attempts++; } }