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 buffer and cache memory #1063

Merged
merged 34 commits into from
Apr 13, 2023
Merged

Add buffer and cache memory #1063

merged 34 commits into from
Apr 13, 2023

Conversation

aragonnetje6
Copy link
Contributor

@aragonnetje6 aragonnetje6 commented Mar 13, 2023

Description

Added a line in the memory graph for the cache and buffer portions of memory. Not sure if this should be stacked on top of the RAM for clarity that this takes up the same space or not. Implementation mostly taken from the RAM implementation. No tests were added since the existing similar parts also do not have tests. The line will always be 0 on windows due to platform-dependent behaviour of sysinfo. perhaps it should be left out there?

image

Issue

Feature: Add buffer and cache memory

Closes: #533

Testing

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

No new tests were added as the existing memory components also have no tests. I'm willing to add these, just let me know if this is desired. All existing tests still pass, and running the program works just fine

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)

…p implementations. placed cache as second in the list as it is more similar to the RAM than any other item in the list
@aragonnetje6 aragonnetje6 changed the title Draft: Draft: Add buffer and cache memory Mar 13, 2023
@ClementTsang
Copy link
Owner

Thanks for this! Whenever it's ready for review, feel free to let me know.

The line will always be 0 on windows due to platform-dependent behaviour of sysinfo. perhaps it should be left out there?

Yeah, it might be better to leave it out through cfg flags if it'll always be a useless stat.

One other comment based on the current pic is I kinda prefer to have the legends aligned, so either spacing is needed or I guess we can abbreviate "CACHE"? "CHE"? I don't know tbh.

@aragonnetje6
Copy link
Contributor Author

Yeah, it might be better to leave it out through cfg flags if it'll always be a useless stat.

Will do!

One other comment based on the current pic is I kinda prefer to have the legends aligned, so either spacing is needed or I guess we can abbreviate "CACHE"? "CHE"? I don't know tbh.

It would be nice to have all entries at 3 letters, and i suppose CHE works.

Also, it was mentioned that this line should perhaps be off by default to prevent cluttering the graph, do you agree? I could add it to clap

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 18.63% and project coverage change: -0.67 ⚠️

Comparison is base (c8c64b0) 26.44% compared to head (911e9d0) 25.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1063      +/-   ##
==========================================
- Coverage   26.44%   25.78%   -0.67%     
==========================================
  Files          83       94      +11     
  Lines       14733    15492     +759     
==========================================
+ Hits         3896     3994      +98     
- Misses      10837    11498     +661     
Flag Coverage Δ
macos-12 27.14% <17.36%> (-0.16%) ⬇️
ubuntu-latest 27.11% <16.77%> (-0.02%) ⬇️
windows-2019 27.19% <27.18%> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
src/app.rs 0.14% <ø> (ø)
src/app/data_harvester.rs 0.00% <0.00%> (ø)
src/app/data_harvester/memory.rs 100.00% <ø> (ø)
src/app/data_harvester/memory/sysinfo.rs 0.00% <0.00%> (ø)
src/app/layout_manager.rs 81.17% <ø> (ø)
src/bin/main.rs 35.94% <0.00%> (-1.56%) ⬇️
src/canvas.rs 0.00% <0.00%> (ø)
src/canvas/canvas_styling/colour_utils.rs 97.53% <ø> (ø)
src/canvas/widgets/mem_basic.rs 0.00% <0.00%> (ø)
src/canvas/widgets/mem_graph.rs 0.00% <0.00%> (ø)
... and 7 more

... and 22 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aragonnetje6
Copy link
Contributor Author

aragonnetje6 commented Mar 13, 2023

I have 2 potential versions now, both working properly, passing tests, and at least compiling for windows (using cross). The version in the master branch just has the cache line on by default, while the version in the "clap" branch it's off by default but can be enabled through the --enable-cache-memory flag. I would love to hear which is preferred!

I also renamed the tag to CHE, since all the others have 3 letters as well.

image

@ClementTsang
Copy link
Owner

Sorry for getting back to you late.

I think for now leaving it off by default might be fine; in the future I might make it easier to access through a config menu.

@aragonnetje6 aragonnetje6 changed the title Draft: Add buffer and cache memory Add buffer and cache memory Mar 19, 2023
@aragonnetje6 aragonnetje6 marked this pull request as ready for review March 19, 2023 20:53
@aragonnetje6
Copy link
Contributor Author

alright, that version has been merged in, documentation has been updated, and i tested on windows in addition to linux. i don't have access to mac, so i can't really test that

@ClementTsang
Copy link
Owner

i don't have access to mac, so i can't really test that

All good, will test that and get back to you.

@ClementTsang ClementTsang self-assigned this Mar 23, 2023
Copy link
Owner

@ClementTsang ClementTsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long. A few nit comments and some small suggestions.

EDIT: Note that you might need to do a rebase, as there were some changes to the unit stored by MemHarvest (it's now in bytes).

docs/content/configuration/command-line-flags.md Outdated Show resolved Hide resolved
docs/content/configuration/config-file/flags.md Outdated Show resolved Hide resolved
src/canvas/canvas_styling.rs Outdated Show resolved Hide resolved
src/app/data_harvester/memory/sysinfo.rs Outdated Show resolved Hide resolved
@aragonnetje6 aragonnetje6 reopened this Mar 31, 2023
@aragonnetje6
Copy link
Contributor Author

well that close was unintentional, merge conflicts with the main repo happened but that's fixed now. i hope the changes are implemented satisfactorily!

Copy link
Owner

@ClementTsang ClementTsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small nits. Otherwise, looks good to me. If you don't think these are worth changing that's also fine, just let me know and I'll approve + merge.

Also, if possible, it would be good to update the default config (sample_configs/default_config.toml) and it's corresponding default file in the application, but I can handle that in a separate commit if you want.

src/app/data_harvester/memory/sysinfo.rs Outdated Show resolved Hide resolved
src/canvas/widgets/mem_basic.rs Outdated Show resolved Hide resolved
aragonnetje6 and others added 5 commits April 10, 2023 18:38
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
Co-authored-by: Clement Tsang <34804052+ClementTsang@users.noreply.github.com>
@ClementTsang ClementTsang self-requested a review April 11, 2023 09:08
Copy link
Owner

@ClementTsang ClementTsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'll merge sometime today or tomorrow. Thanks!

@ClementTsang
Copy link
Owner

@all-contributors please add @aragonnetje6 for code.

@allcontributors
Copy link
Contributor

@ClementTsang

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

@ClementTsang ClementTsang merged commit 1b1e80e into ClementTsang:master Apr 13, 2023
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.

Feature: Add buffer and cache memory
2 participants