Repository navigation
Conversation
The `buck2 log critical-path` and `buck2 log slowest-path` commands
print human-readable output that's quite difficult to read:
- Many output lines represent sub-millisecond durations.
- Output is uncolored, so it's hard to tell which lines are relevant
at a glance.
- There are lots of lines for `waiting unknown`, which are generally not
very useful.
- `waiting unknown` lines cause a single 'human-legible' line to be
split into dozens of entries.
- All times are printed in microseconds, so I hope you can divide by a
million in your head :)
- Columns are not named very clearly; the `waiting` column indicates
time that overlapped other work (and did not extend the build).
Here we fix those issues:
- Lines are colored by duration:
- <100ms is gray
- <1s is normal
- <5s is yellow
- <10s is red
- >10s is bright/bold red
- Consecutive lines (including 'waiting unknown' lines) are deduplicated
and summed together.
- A new `--threshold` option can be used to hide small entries, e.g.
`--threshold=10ms`.
- If the `--threshold` option is used, the output will end with a line
explaining how much was hidden: "hid 778 low-impact entries under
10.0ms, totaling 1.10s".
- The output begins with a legend explaining what the column names mean.
With these changes, an 828-line `buck2 log critical-path` output can be
condensed to a very human-readable 51 lines (including legend and blank
lines).
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D134544285. (Because this pull request was imported automatically, there will not be any future comments.) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
buck2 log critical-pathandbuck2 log slowest-pathcommands print human-readable output that's quite difficult to read:waiting unknown, which are generally not very useful.waiting unknownlines cause a single 'human-legible' line to be split into dozens of entries.waitingcolumn indicates time that overlapped other work (and did not extend the build).Here we fix those issues:
--thresholdoption can be used to hide small entries, e.g.--threshold=10ms.--thresholdoption is used, the output will end with a line explaining how much was hidden: "hid 778 low-impact entries under 10.0ms, totaling 1.10s".With these changes, the
critical-pathoutput for a large build can be condensed from 828 lines to to a very human-readable 51 lines (including legend and blank lines).Here is an example from an open-source build. Before (only a small portion of the output is shown, full output is 222 lines):
After (53 lines):