- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.2k
 
Closed
Closed
Copy link
Labels
A-Dev-ToolsTools used to debug Bevy applications.Tools used to debug Bevy applications.A-DiagnosticsLogging, crash handling, error reporting and performance analysisLogging, crash handling, error reporting and performance analysisC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
What problem does this solve or what need does it fill?
System cpu/memory is useful but current process cpu/memory is even more useful.
What solution would you like?
Adding 2 extra metrics:
- process/cpu_usage in %core, eg 200% if 2 cores in use
 - process/mem_usage in MB
 
What alternative(s) have you considered?
Extending the plugin in my own app
Additional context
Following code would need to be added to fetch the info.
                let pid = sysinfo::get_current_pid().expect("Failed to get current process ID");
                sys.refresh_processes(ProcessesToUpdate::Some(&[pid]), true);
                let process_mem_usage = sys
                    .process(pid)
                    .map(|p| p.memory() as f64 / 1024.0 / 1024.0) // Convert to MB
                    .unwrap_or(0.0);
                let process_cpu_usage = sys
                    .process(pid)
                    .map(|p| p.cpu_usage() as f64)
                    .unwrap_or(0.0);If there is interest in this I'm willing to create a PR
Metadata
Metadata
Assignees
Labels
A-Dev-ToolsTools used to debug Bevy applications.Tools used to debug Bevy applications.A-DiagnosticsLogging, crash handling, error reporting and performance analysisLogging, crash handling, error reporting and performance analysisC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!