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

Add support for displaying load average #392

Merged
merged 10 commits into from
Mar 13, 2021

Conversation

pvanheus
Copy link
Contributor

Description

Add support for showing load average (as part of the CPU display).

Issue

Addresses one part of what is mentioned in #235. Please comment on how display is done.

Type of change

Remove the irrelevant ones:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (if this change causes breakage or new behaviour, please state what)
  • Refactoring (a change that doesn't change application functionality)
  • Other (something else - please specify)

Test methodology

Tested by running on Linux.

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

@ClementTsang
Copy link
Owner

Sorry for getting to this so late!

Made some slight changes:

  • Disabled on Windows, it does nothing there from what I can tell
  • Used heim to avoid an unnecessary sysinfo invocation
  • Spaced out the load average a bit better
  • Force 2 decimal places to avoid weird shifting

Final look:
image

Ideally this would be user-toggleable via config/flag and work on basic mod as well, but it's fine, I'll gladly accept it as is.

@ClementTsang ClementTsang merged commit d8f8a92 into ClementTsang:master Mar 13, 2021
@ClementTsang
Copy link
Owner

ClementTsang commented Mar 23, 2021

@all-contributors please add @pvanheus for code

Totally forgot to do this, mb!

@allcontributors
Copy link
Contributor

@ClementTsang

I've put up a pull request to add @pvanheus! 🎉

Repository owner deleted a comment from allcontributors bot Mar 23, 2021
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