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

Hide unused ARC and SWP in Basic Mode #1667

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

jamartin9
Copy link
Contributor

@jamartin9 jamartin9 commented Feb 4, 2025

Description

This change allows the ARC and SWP to be hidden on Basic Mode again when not in use; by returning None when mem_total is invalid.

Before the rework this happened in data_conversion.rs with convert_mem_label...
Alternatively we could adjust the basic layout in canvas.rs to use data points(again) and filter in mem_basic like graph_data does for mem_graph.

Linux Basic Mode with changes:
btm-patched

Linux Basic Mode without changes(current):

btm

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 Feb 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 42.14%. Comparing base (ec1a4cb) to head (25007d4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/collection/memory/arc.rs 0.00% 6 Missing ⚠️
src/collection/memory/sysinfo.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1667   +/-   ##
=======================================
  Coverage   42.13%   42.14%           
=======================================
  Files         110      110           
  Lines       17478    17481    +3     
=======================================
+ Hits         7365     7368    +3     
  Misses      10113    10113           
Flag Coverage Δ
macos-14 37.78% <0.00%> (-0.01%) ⬇️
ubuntu-latest 43.92% <0.00%> (+0.01%) ⬆️
windows-2019 37.67% <0.00%> (-0.01%) ⬇️

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
Copy link
Owner

ClementTsang commented Feb 6, 2025

This does work, though I think you might need to update cache and gpu as well for consistency. Otherwise looks fine to me.

Alternatively, just skip adding rows in canvas.rs and don't add a PipeGauge if the total is 0.

@jamartin9
Copy link
Contributor Author

jamartin9 commented Feb 6, 2025

This does work, though I think you might need to update cache and gpu as well for consistency.

The GPU collections already return None for memory if unable to collect.
Cache mem_total should never be 0 as it is the total system memory like RAM.
Both cache and gpu can be toggled in the config for layout (unlike swap/arc).

Alternatively, just skip adding rows in canvas.rs and don't add a PipeGauge if the total is 0.

returning None for values not present seemed preferable to filtering empty values.

Either way the regression would be fixed

@ClementTsang ClementTsang merged commit 22fbd7d into ClementTsang:main Feb 8, 2025
37 checks passed
@ClementTsang
Copy link
Owner

LGTM then, thanks!

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.

2 participants