-
Notifications
You must be signed in to change notification settings - Fork 5
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
Process tree and skip rows #55
Merged
Merged
Conversation
This file contains 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
We now return all processes instead of filtering, hardcode categories instead of taking a param, and parse the parent pid. This cost just 1.5ms (with a running ebuild), and is a step towards displaying the emerge process tree.
* Formatting/editing of commandline is delayed until display time (potentially saving a few cycles) * Display width is now user-configurable (should be in the `predict` section only, but that's a refactoring for another day) * Switched from std `Display` to our `Disp` trait That last part is the initial motivation, as I want to be able to pass an `indent` argument.
Needs some refinements, but the basic functionality is here.
This was the original intent, and fixes an off-by-one in the error message.
Simpler code, and saves an alloc.
Better heuristics to isolate the the interesting part of the process name, and switched from regex to plain string search.
Mainly for newlines, but let's match a bit wider to be sure.
Still not sure what the best value is, but this is enough to see the current stage.
Making this a global option, as I want to eventually use that for --first/--last skips too.
Basic indentation&skip unittest, plus some refactoring to decouple proces/current/command a bit.
There's a small time window during which `emerge` might spawn `emerge`, so it looks like we have two running. This is a longstanding emlop bug, but it's much more noticeable now that we display the proces hierarchy. Fix this by removing roots if their (grand)parent is also a root. Added unittest (which prompted the previous refactorings).
vincentdephily
force-pushed
the
process_tree
branch
from
October 28, 2024 18:35
86df757
to
ba073ee
Compare
By storing the header as its own member instead of a row. This simplifies the logic a bit (might even be a micro perf win), but more importantly will simplify inserting a `skipped` row between the header and the actual rows. Added a unittest to make sure we handle the header's width. As a bonus, newer clippy versions don't complain about needless_range_loop, so remove the `allow`.
This makes it a bit clearer API-wise that tables can only have one header.
This means that `--first 1` now needs to read the entire log and is no longer as fast, but the reature is worth it (and is optional via `--elipsis=n`). I'm not too happy with the padding at the end of the skip row, and the inconsistency with the `--last` skip row (no padding and no column align), but no need to be perfect at this stage.
Because I'm afraid that the word "elipsis" is too obscure (especially for non-native speakers), and to make the relationship between the output and the option clearer.
vincentdephily
force-pushed
the
process_tree
branch
from
October 30, 2024 22:16
65a9f06
to
1481285
Compare
This one turned out to be trivial. Removing the "hidden" count from the summary line, as it seems redundant and less clear.
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.
Simple feature but with a long tail of little details and fixes