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: Hide SWAP graph and legend in normal mode if SWAP is 0 #372

Merged
merged 4 commits into from Dec 22, 2020

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Dec 22, 2020

Description

A description of the change and what it does. If relevant, please provide screenshots of what results from the change:

Firstly, note this currently won't affect basic mode. There is code changes due to it, but instead, we'll just display 0B/0B instead. I'm personally not really sure if we want to get rid of it in basic mode, since it'll leave an ugly gap in that mode.

Anyways, this change is mainly for the normal mode. All this does is hide the legend entry and chart if the total SWAP drops to 0 KB. It also has a small change to do a unit check on the memory used, as well as slightly adjusting the calculation we use.

image
image

Issue

If applicable, what issue does this address?

Closes: #370

Type of change

Remove the irrelevant ones:

  • New feature (non-breaking change which adds functionality)

Test methodology

If relevant, please state how this was tested:

Furthermore, please tick which platforms this change was tested on:

  • Windows
  • macOS
  • Linux

If relevant, all of these platforms should be tested.

Checklist

If relevant, ensure the following have been met:

  • Change has been tested to work, and does not cause new breakage unless intended
  • Code has been self-reviewed
  • Documentation has been added/updated if needed (README, help menu, etc.)
  • Passes CI pipeline (clippy check and cargo test check)
  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • No merge conflicts arise from the change

Other information

Provide any other relevant information to this change:

Firstly, note this currently won't affect basic mode.  There is
code changes due to it, but instead, we'll just display `0B/0B`
instead.  I'm personally not really sure if we want to get rid
of it in basic mode, since it'll leave an ugly gap in that mode.

Anyways, this change is mainly for the normal mode.  All this does
is hide the legend entry and chart if the total SWAP drops to 0 KB.
That's it.
@ClementTsang ClementTsang merged commit 9d1f3c9 into master Dec 22, 2020
@ClementTsang ClementTsang deleted the hide_swap_if_zero branch December 22, 2020 06:12
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.

Disable swap monitoring if none is available.
1 participant