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

bug: Fix process CPU calculation if /proc/stat CPU line has less values than expected #637

Merged
merged 4 commits into from
Dec 21, 2021

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Dec 21, 2021

Description

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

Addresses a potential case where processing would fail if there were missing values from the CPU line of /proc/stat, and allows it to successfully return.

Issue

If applicable, what issue does this address?

Closes: #636

Testing

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

Please also indicate which platforms were tested. All platforms directly affected by the change must be 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, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts

@codecov-commenter
Copy link

Codecov Report

Merging #637 (453558e) into master (065ffdb) will increase coverage by 0.33%.
The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #637      +/-   ##
=========================================
+ Coverage    6.82%   7.15%   +0.33%     
=========================================
  Files          52      52              
  Lines        8269    8284      +15     
=========================================
+ Hits          564     593      +29     
+ Misses       7705    7691      -14     
Impacted Files Coverage Δ
src/app/data_harvester/processes/linux.rs 20.42% <96.66%> (+20.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6a112b...453558e. Read the comment docs.

@ClementTsang ClementTsang changed the title bug: Fix parsing less values than expected while calculating total CPU usage for processes bug: Fix process CPU calculation if /proc/stat CPU line has less values than expected Dec 21, 2021
@ClementTsang ClementTsang merged commit d32a74e into master Dec 21, 2021
@ClementTsang ClementTsang deleted the fix_missing_process_cpu_vals branch December 21, 2021 23:17
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.

CPU parsing will fail due to too short of a return value
2 participants