-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
profile: add profile_finish_ts #17636
Conversation
@fweikert I think you own the Bazel profiling code, could you please take a look? |
src/main/java/com/google/devtools/build/lib/profiler/JsonTraceFileWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/profiler/JsonTraceFileWriter.java
Outdated
Show resolved
Hide resolved
Hi @sluongng, Could you please respond to the review comments and changes. Thanks! |
It has been relatively long time so I lost part of the context for this change. Took me a bit to review this to see why I needed it: For translating Bazel Profile to Open Telemetry data format, I need a parable time stamp. Updated according to review feedbacks. |
@@ -167,7 +167,7 @@ Example: | |||
{ | |||
"otherData": { | |||
"build_id": "101bff9a-7243-4c1a-8503-9dc6ae4c3b05", | |||
"date": "Wed Oct 26 08:22:35 CEST 2022", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep the date in the example
"date" field in Bazel json profile is a confusing field. - It uses Java Date.toString() output which includes local timezone that could be hard to parse. - The name is misleading since users could mistook it for profile start time, while it actually means the finish/end time, when Bazel calls the writer to serialize profiling data to disk. Add "profile_finish_ts" which has a clearer name and more consistent value with the time unit being used in the rest of the JSON profile(microseconds). We shall deprecate the "date" field in a separate patch in a major release.
6397870
to
cbae4a4
Compare
@meisterT I updated both the diff and the commit message / PR summary accordingly. Do you want to introduce the deprecation patch or shall I? |
Thanks!
Feel free to send a separate PR for this! |
@bazel-io flag |
@bazel-io fork 6.2.0 |
There were many changes we did not cherry pick into 6.1. If we want this functionality in 6.2, I think the easiest is to repeat the spirit of this change instead of cherrypicking other changes. |
Recreated in #18129 |
Repeating change from bazelbuild#17636 for 6.2 release
"date" field in Bazel json profile is a confusing field. - It uses Java Date.toString() output which includes local timezone that could be hard to parse. - The name is misleading since users could mistook it for profile start time, while it actually means the finish/end time, when Bazel calls the writer to serialize profiling data to disk. Add "profile_finish_ts" which has a clearer name and more consistent value with the time unit being used in the rest of the JSON profile(microseconds). We shall deprecate the "date" field in a separate patch in a major release. Closes bazelbuild#17636. PiperOrigin-RevId: 524817808 Change-Id: I89e144d42f0e608818507f5f9f9bc525c9dc7ac3
Hi @sluongng, I don't think this change is correct. You wrote that
but this method is actually called at the beginning of the Bazel process. Additionally, Edit: Filed a ticket: #22505 |
"date" field in Bazel json profile is a confusing field.
It uses Java Date.toString() output which includes local timezone
that could be hard to parse.
The name is misleading since users could mistook it for profile
start time, while it actually means the finish/end time, when
Bazel calls the writer to serialize profiling data to disk.
Add "profile_finish_ts" which has a clearer name and more consistent
value with the time unit being used in the rest of the JSON
profile(microseconds).
We shall deprecate the "date" field in a separate patch in a major
release.