From cbbe54bb52353d5ec683126907cd8e5c9ec835ca Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 31 Jul 2023 06:59:07 -0700 Subject: [PATCH] Rename PROCESS_TIME to REMOTE_PROCESS_TIME to reflect the fact that it's used to mark remote execution wall time. Currently, PROCESS_TIME is used in LocalSpawnRunner to record the local execution time, but displayed as remote execution time in the Profiler which is confusing. This change reduces the chance PROCESS_TIME is misused in the future and a following change will fix LocalSpawnRunner. PiperOrigin-RevId: 552467817 Change-Id: I4383be640571fd816fb2c71fec29f60e693d4347 --- .../devtools/build/lib/exec/local/LocalSpawnRunner.java | 3 ++- .../com/google/devtools/build/lib/profiler/ProfilerTask.java | 2 +- .../google/devtools/build/lib/remote/RemoteSpawnRunner.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) 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 3d9ce428385932..cbcc6e7d997ba5 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 @@ -425,7 +425,8 @@ private SpawnResult start() TerminationStatus terminationStatus; try (SilentCloseable c = Profiler.instance() - .profile(ProfilerTask.PROCESS_TIME, spawn.getResourceOwner().getMnemonic())) { + .profile( + ProfilerTask.REMOTE_PROCESS_TIME, spawn.getResourceOwner().getMnemonic())) { needCleanup = true; Subprocess subprocess = subprocessBuilder.start(); try { diff --git a/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java b/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java index f317a3ffe8a52d..8733b86cbe2477 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java +++ b/src/main/java/com/google/devtools/build/lib/profiler/ProfilerTask.java @@ -38,7 +38,7 @@ public enum ProfilerTask { Threshold.FIFTY_MILLIS, /* collectsSlowestInstances= */ true), UPLOAD_TIME("Remote execution upload time", Threshold.FIFTY_MILLIS), - PROCESS_TIME("Remote execution process wall time", Threshold.FIFTY_MILLIS), + REMOTE_PROCESS_TIME("Remote execution process wall time", Threshold.FIFTY_MILLIS), REMOTE_QUEUE("Remote execution queuing time", Threshold.FIFTY_MILLIS), REMOTE_SETUP("Remote execution setup", Threshold.FIFTY_MILLIS), FETCH("Remote execution file fetching", Threshold.FIFTY_MILLIS), diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java index 4d82a88c60191c..fbc44c59550bff 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java @@ -15,9 +15,9 @@ package com.google.devtools.build.lib.remote; import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.devtools.build.lib.profiler.ProfilerTask.PROCESS_TIME; import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_DOWNLOAD; import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_EXECUTION; +import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_PROCESS_TIME; import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_QUEUE; import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_SETUP; import static com.google.devtools.build.lib.profiler.ProfilerTask.UPLOAD_TIME; @@ -342,7 +342,7 @@ private static void profileAccounting(ExecutedActionMetadata executedActionMetad converter, executedActionMetadata.getExecutionStartTimestamp(), executedActionMetadata.getExecutionCompletedTimestamp(), - PROCESS_TIME, + REMOTE_PROCESS_TIME, "execute"); logProfileTask( converter,