Search in sources :

Example 1 with ExecutedActionMetadata

use of build.bazel.remote.execution.v2.ExecutedActionMetadata in project bazel-buildfarm by bazelbuild.

the class Cat method printActionResult.

@SuppressWarnings("ConstantConditions")
private static void printActionResult(ActionResult result, int indentLevel) {
    for (OutputFile outputFile : result.getOutputFilesList()) {
        String attrs = "";
        if (outputFile.getIsExecutable()) {
            attrs += (attrs.length() == 0 ? "" : ",") + "executable";
        }
        if (attrs.length() != 0) {
            attrs = " (" + attrs + ")";
        }
        indentOut(indentLevel, "Output File: " + outputFile.getPath() + attrs + " File " + DigestUtil.toString(outputFile.getDigest()));
    }
    for (OutputDirectory outputDirectory : result.getOutputDirectoriesList()) {
        indentOut(indentLevel, "Output Directory: " + outputDirectory.getPath() + " Directory " + DigestUtil.toString(outputDirectory.getTreeDigest()));
    }
    indentOut(indentLevel, "Exit Code: " + result.getExitCode());
    if (!result.getStdoutRaw().isEmpty()) {
        indentOut(indentLevel, "Stdout: " + result.getStdoutRaw().toStringUtf8());
    }
    if (result.hasStdoutDigest()) {
        indentOut(indentLevel, "Stdout Digest: " + DigestUtil.toString(result.getStdoutDigest()));
    }
    if (!result.getStderrRaw().isEmpty()) {
        indentOut(indentLevel, "Stderr: " + result.getStderrRaw().toStringUtf8());
    }
    if (result.hasStderrDigest()) {
        indentOut(indentLevel, "Stderr Digest: " + DigestUtil.toString(result.getStderrDigest()));
    }
    if (result.hasExecutionMetadata()) {
        indentOut(indentLevel, "ExecutionMetadata:");
        ExecutedActionMetadata executedActionMetadata = result.getExecutionMetadata();
        indentOut(indentLevel + 1, "Worker: " + executedActionMetadata.getWorker());
        indentOut(indentLevel + 1, "Queued At: " + Timestamps.toString(executedActionMetadata.getQueuedTimestamp()));
        indentOut(indentLevel + 1, "Worker Start: " + Timestamps.toString(executedActionMetadata.getWorkerStartTimestamp()));
        indentOut(indentLevel + 1, "Input Fetch Start: " + Timestamps.toString(executedActionMetadata.getInputFetchStartTimestamp()));
        indentOut(indentLevel + 1, "Input Fetch Completed: " + Timestamps.toString(executedActionMetadata.getInputFetchCompletedTimestamp()));
        indentOut(indentLevel + 1, "Execution Start: " + Timestamps.toString(executedActionMetadata.getExecutionStartTimestamp()));
        indentOut(indentLevel + 1, "Execution Completed: " + Timestamps.toString(executedActionMetadata.getExecutionCompletedTimestamp()));
        indentOut(indentLevel + 1, "Output Upload Start: " + Timestamps.toString(executedActionMetadata.getOutputUploadStartTimestamp()));
        indentOut(indentLevel + 1, "Output Upload Completed: " + Timestamps.toString(executedActionMetadata.getOutputUploadCompletedTimestamp()));
        indentOut(indentLevel + 1, "Worker Completed: " + Timestamps.toString(executedActionMetadata.getWorkerCompletedTimestamp()));
    }
}
Also used : OutputFile(build.bazel.remote.execution.v2.OutputFile) OutputDirectory(build.bazel.remote.execution.v2.OutputDirectory) ExecutedActionMetadata(build.bazel.remote.execution.v2.ExecutedActionMetadata) ByteString(com.google.protobuf.ByteString)

Aggregations

ExecutedActionMetadata (build.bazel.remote.execution.v2.ExecutedActionMetadata)1 OutputDirectory (build.bazel.remote.execution.v2.OutputDirectory)1 OutputFile (build.bazel.remote.execution.v2.OutputFile)1 ByteString (com.google.protobuf.ByteString)1