Skip to content

Commit

Permalink
profile: add profile_finish_ts
Browse files Browse the repository at this point in the history
Repeating change from bazelbuild#17636 for 6.2 release
  • Loading branch information
sluongng committed Apr 18, 2023
1 parent 3687b56 commit 5ced37d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions site/en/rules/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ Example:
"otherData": {
"build_id": "101bff9a-7243-4c1a-8503-9dc6ae4c3b05",
"date": "Tue Jun 16 08:30:21 CEST 2020",
"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 @@ -39,6 +39,7 @@
import java.lang.management.ManagementFactory;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
Expand Down Expand Up @@ -1086,13 +1087,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

0 comments on commit 5ced37d

Please sign in to comment.