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

profile: add profile_finish_ts #17636

Closed
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
1 change: 1 addition & 0 deletions site/en/advanced/performance/json-trace-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Example:
"otherData": {
"build_id": "101bff9a-7243-4c1a-8503-9dc6ae4c3b05",
"date": "Wed Oct 26 08:22:35 CEST 2022",
"profile_finish_ts": "1677666095162000",
"output_base": "/usr/local/google/_bazel_johndoe/573d4be77eaa72b91a3dfaa497bf8cd0"
},
"traceEvents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
import java.util.HashMap;
import java.util.UUID;
Expand Down Expand Up @@ -172,13 +173,15 @@ public void run() {
// The buffer size of 262144 is chosen at random.
new OutputStreamWriter(
new BufferedOutputStream(outStream, 262144), StandardCharsets.UTF_8))) {
var finishDate = Instant.now();
writer.beginObject();
writer.name("otherData");
writer.beginObject();
writer.name("bazel_version").value(BlazeVersionInfo.instance().getReleaseName());
writer.name("build_id").value(buildID.toString());
writer.name("output_base").value(outputBase);
writer.name("date").value(new Date().toString());
writer.name("date").value(finishDate.toString());
writer.name("profile_finish_ts").value(finishDate.getEpochSecond() * 1000);
writer.endObject();
writer.name("traceEvents");
writer.beginArray();
Expand Down