Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4.0] Add target label to SpawnExec in the execution log #16728

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public void logSpawn(
}
builder.setMnemonic(spawn.getMnemonic());
builder.setWalltime(Durations.fromNanos(result.getMetrics().executionWallTime().toNanos()));

if (spawn.getTargetLabel() != null) {
builder.setTargetLabel(spawn.getTargetLabel());
}

executionLog.write(builder.build());
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/protobuf/spawn.proto
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ message SpawnExec {
// The wall time it took to execute the Spawn. This is only the time spent in
// the subprocess, not including the time doing setup and teardown.
google.protobuf.Duration walltime = 17;

// Canonical label of the target that emitted this spawn, may not always be
// set.
string target_label = 18;
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public void testLogSpawn() throws Exception {
.setMnemonic("MyMnemonic")
.setRunner("runner")
.setWalltime(Duration.getDefaultInstance())
.setTargetLabel("//dummy:label")
.build();
verify(messageOutput).write(expectedSpawnLog);
}
Expand Down Expand Up @@ -491,6 +492,7 @@ private static SpawnExec.Builder defaultSpawnExecBuilder(String cmd) {
.setStatus("NON_ZERO_EXIT")
.setExitCode(23)
.setRemoteCacheable(true)
.setWalltime(Duration.getDefaultInstance());
.setWalltime(Duration.getDefaultInstance())
.setTargetLabel("//dummy:label");
}
}