-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Feat/new stdout exporter switches (Add option to display more than five processes) #98
Feat/new stdout exporter switches (Add option to display more than five processes) #98
Conversation
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.
It's great and works all fine, thanks a lot ! I'd just suggest to allow both options to run together (-p being a limit for the number of processes -r returns).
scaphandre stdout -p 20 | ||
|
||
You can filter the processes to display with `-r`. A warning will be risen if this option is used with `-p` at the same time. | ||
In such case, `-p` behavior is disabled. |
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.
I'd find more intuitive to pe able to use both. -p could then be used to limit the number of results from -r. Is there a particular challenge to do it I don't see right now ? WDYT ?
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.
Hello @bpetit,
No there is no challenge to mix the both options. However I made it "incompatible" because, the default value of -p is 5 even if you don't specify it. I thought it could be misleading, because it could truncate the filtered output silently.
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.
I understand. Actually it seems fine to me too to declare those options incompatible.
- Introduce new switches -p (number of consumers) and -r (regex filter) - Display the chosen number of consumers - Start implementation of filter
- Filters implemented TODO: - Refactor get_filtered_processes(). - Explain that -f as priority over -p. - Documentation update.
- Refactor get_filtered_processes() and get_top_consumers().
- Explain that -r as priority over -p. - Add a warning if -p and -r are used at the same time. - Remove default values for regex_filter.
- Update documentation.
- Fix clippy warnings
35e00fc
to
394b81e
Compare
@bpetit , this is rebased.
Despite I checked it, please have a quick new review to be sure the rebase has not introduced something wrong. Then I think you will be able to merge this MR. |
Hello,
This MR fixes #91.