Skip to content

Commit fe9e9e0

Browse files
sluongngcopybara-github
authored andcommitted
RemoteSpawnRunner: record inbetween phases in timing profile
After an action was executed remotely, RemoteSpawnRunner would use the timestamps in the execution metadata to record appropriate timing phases into the JSON profile. However, there are durations in-between the existing phases that are unaccounted for. Depending on the RBE server implemenation, these phases could mean different things: - Sandbox preparation - Cleaning up sandbox environments post-execution - Others Missing these durations inside the timing profile would cause confusion to end users as it would be interpreted as nothing happened in between the existing phases. Add these durations into the profile as "pre-X" phases so that user is aware of activities could still be happening during that time. RBE server implementation should be able to alter these label programmatically if necessary. Closes #20387. PiperOrigin-RevId: 590816782 Change-Id: I2bee36be928db24a14fab18bc519c3893723b7d6
1 parent 1bcb68c commit fe9e9e0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package com.google.devtools.build.lib.remote;
1616

1717
import static com.google.common.base.Preconditions.checkNotNull;
18+
import static com.google.devtools.build.lib.profiler.ProfilerTask.FETCH;
1819
import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_DOWNLOAD;
1920
import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_EXECUTION;
2021
import static com.google.devtools.build.lib.profiler.ProfilerTask.REMOTE_PROCESS_TIME;
@@ -341,16 +342,34 @@ private static void profileAccounting(ExecutedActionMetadata executedActionMetad
341342
"queue");
342343
logProfileTask(
343344
converter,
345+
executedActionMetadata.getWorkerStartTimestamp(),
344346
executedActionMetadata.getInputFetchStartTimestamp(),
345-
executedActionMetadata.getInputFetchCompletedTimestamp(),
346347
REMOTE_SETUP,
348+
"pre-fetch");
349+
logProfileTask(
350+
converter,
351+
executedActionMetadata.getInputFetchStartTimestamp(),
352+
executedActionMetadata.getInputFetchCompletedTimestamp(),
353+
FETCH,
347354
"fetch");
355+
logProfileTask(
356+
converter,
357+
executedActionMetadata.getInputFetchCompletedTimestamp(),
358+
executedActionMetadata.getExecutionStartTimestamp(),
359+
REMOTE_SETUP,
360+
"pre-execute");
348361
logProfileTask(
349362
converter,
350363
executedActionMetadata.getExecutionStartTimestamp(),
351364
executedActionMetadata.getExecutionCompletedTimestamp(),
352365
REMOTE_PROCESS_TIME,
353366
"execute");
367+
logProfileTask(
368+
converter,
369+
executedActionMetadata.getExecutionCompletedTimestamp(),
370+
executedActionMetadata.getOutputUploadStartTimestamp(),
371+
REMOTE_SETUP,
372+
"pre-upload");
354373
logProfileTask(
355374
converter,
356375
executedActionMetadata.getOutputUploadStartTimestamp(),

0 commit comments

Comments
 (0)