.setMaxStdout(1048576)
.setMaxStderr(65536)
.setTimeout(5)
.setCwd(".")
.build();
RunCommandResponse response = slaveService.runCommand(null, request);
System.out.println("\nerr = " + response.getErrorCode());
if (response.getErrorCode() == 0) {
System.out.println("pid " + response.getPid());
System.out.println("seconds " + (response.getFinishTimeUs() - response.getStartTimeUs()) / 1000000.0);
System.out.println("exit " + response.getExitStatus());
System.out.println("signaled " + response.getSignaled());
System.out.print(response.getCoredump() ? "core dump\n" : "");
System.out.println("max mem " + response.getMemoryMaxrssKb());
System.out.println("stdout len " + response.getStdOutput().size());
if (response.getStdOutput().size() > 0 && response.getStdOutput().size() < 8192) {
System.out.println(response.getStdOutput().toStringUtf8());
}
System.out.println("stderr len " + response.getStdError().size());
if (response.getStdError().size() > 0 && response.getStdError().size() < 8192) {
System.out.println(response.getStdError().toStringUtf8());
}
}
}