-
Notifications
You must be signed in to change notification settings - Fork 660
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
get available CPUs and RAM from daemon when launching a new instance in GUI #3867
Conversation
5867f84
to
af771ec
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3867 +/- ##
==========================================
- Coverage 89.03% 89.02% -0.01%
==========================================
Files 255 255
Lines 14577 14583 +6
==========================================
+ Hits 12978 12982 +4
- Misses 1599 1601 +2 ☔ View full report in Codecov by Sentry. |
bad74f2
to
d29c1fe
Compare
13c9059
to
9874339
Compare
78439bd
to
94d3af8
Compare
a5f591c
to
db8d38b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @levkropp! Good job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done Lev, thanks! Just a couple of small details inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good @levkropp, thanks!
* edit DaemonInfoReply proto call to have cpus & memory * implement basic cpu and mem usage getter for linux in daemon.cpp * implement basic hook for daemonInfoProvider in providers.dart and launch_form.dart
* cpus is now a uint32 in multipass.proto * removed LinuxSystemInfo struct and replaced with two functions * get_cpus() and get_total_ram() are now platform functions with a linux implementation * configuring a VM's resources now uses daemonInfoProvider properly * cpu, ram, and disk sliders get from daemonInfoProvder in providers.dart instead of their own defined providers
64da0bb
to
96f5187
Compare
This PR addresses #3838 by improving how the GUI gets system resource information. Instead of the GUI directly checking system specs (like CPU count and memory size), we now pull that data from the daemon via a new gRPC call. This keeps the logic centralized in the daemon, which already handles disk space reporting, so it makes sense to extend that to cover CPUs and memory as well.
Daemon updates:
_SC_NPROCESSORS_ONLN
and_SC_PHYS_PAGES * _SC_PAGESIZE
to get CPU count and total ram size respectively. This info is now included in theDaemonInfoReply
message.GUI changes:
LaunchForm
to show available CPUs, memory, and storage in the UI by usingdaemonInfoProvider
.