Skip to content
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

feature: support default selection of average CPU graph #1353

Merged
merged 2 commits into from
Dec 10, 2023

Conversation

ClementTsang
Copy link
Owner

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

Issue

If applicable, what issue does this address?

Closes: #1350

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

Copy link

codecov bot commented Dec 10, 2023

Codecov Report

Attention: 30 lines in your changes are missing coverage. Please review.

Comparison is base (300f667) 31.93% compared to head (8df3c57) 32.09%.

Files Patch % Lines
src/app.rs 0.00% 10 Missing ⚠️
src/components/data_table/draw.rs 0.00% 7 Missing ⚠️
src/widgets/cpu_graph.rs 50.00% 5 Missing ⚠️
src/components/data_table.rs 55.55% 4 Missing ⚠️
src/options/cpu.rs 90.90% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1353      +/-   ##
==========================================
+ Coverage   31.93%   32.09%   +0.15%     
==========================================
  Files          97       98       +1     
  Lines       17048    17113      +65     
==========================================
+ Hits         5444     5492      +48     
- Misses      11604    11621      +17     
Flag Coverage Δ
macos-12 33.87% <65.11%> (+0.16%) ⬆️
ubuntu-latest 33.67% <65.11%> (+0.16%) ⬆️
windows-2019 33.92% <65.11%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementTsang ClementTsang marked this pull request as ready for review December 10, 2023 19:53
@ClementTsang ClementTsang merged commit b6f92c2 into main Dec 10, 2023
33 checks passed
@ClementTsang ClementTsang deleted the default_cpu_avg branch December 10, 2023 20:21
@ShalokShalom
Copy link

I see yet no handle, is this intended?
(Command line flag, option)

@ClementTsang
Copy link
Owner Author

ClementTsang commented Dec 11, 2023

Intended. Aiming to cut down on some of the command-line flags.

That said I do need to update docs.

@ShalokShalom
Copy link

Ah shit. I do think this update will not work for my use case then.
Why do you want to remove command line flags, if you may like to specify..?
That seems rather regressive.

@ClementTsang
Copy link
Owner Author

ClementTsang commented Dec 12, 2023

I'm not removing any at the moment, but I would prefer to add new functionality behind configs unless it makes sense to add a corresponding command line arg. I used to have a matching config for every command arg and now I feel like the command line argument list is a bit of a mess.

This also holds true in the opposite direction, in that I might add args but not a config option if it doesn't seem like it'll be useful.

My personal understanding of an option like this is that it's something you generally would want set permanently... hence why I only made it a config file option.

@ClementTsang
Copy link
Owner Author

ClementTsang commented Dec 12, 2023

That said, if there is interest in having it as a command line argument, I'll take a look.

@ShalokShalom
Copy link

My personal understanding of an option like this is that it's something you generally would want set permanently... hence why I only made it a config file option.

The way I make this permanent, is via a command line option. I have an alias for starters, and not even touched the config file yet. It would be one more config file to maintain and keep up in my head. And I prefer to just have one alias line in my shell config, and thats it.

Now removing already used command line arguments would also break the user flow (scripts, again aliases in configurations) for a minor improvement, imho.

@ClementTsang
Copy link
Owner Author

ClementTsang commented Dec 13, 2023

Major/minor versions are declared as breaking, so 🤷 - I'm not the Rust project that plans on supporting every decision I've made in the past with perfect backwards compatibility forever. I have changed options and command line args before so that ship has long since sailed. That said, as I mentioned above, I am not really planning on removing current command line arguments at the moment.

The config managing thing also wouldn't really be an issue if I finally get time to land #159. There are also many options in bottom that you cannot currently manage outside of config fields, so if you plan on ever using those, then you would have to open the automatically generated config file.

That said, both of these topics are beyond the point of this PR. As for something on-topic, I'll look at adding a corresponding command-line arg, I think I'm okay with it for this one if I reorganize a few things first.

@ShalokShalom
Copy link

Should I create a new issue for it?

@ClementTsang
Copy link
Owner Author

It's fine, no need since I'll probably just do it tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for selecting the average CPU by default when starting bottom
2 participants