Update metrics.rs
This commit is contained in:
parent
f0858525e8
commit
b249c7ba99
@ -449,18 +449,10 @@ pub async fn collect_processes_all(state: &AppState) -> ProcessesPayload {
|
||||
// Optimize refresh strategy based on system load
|
||||
if load > 5.0 {
|
||||
// For active systems, get accurate CPU metrics
|
||||
sys.refresh_processes_specifics(
|
||||
ProcessesToUpdate::All,
|
||||
false,
|
||||
kind.with_cpu(),
|
||||
);
|
||||
sys.refresh_processes_specifics(ProcessesToUpdate::All, false, kind.with_cpu());
|
||||
} else {
|
||||
// For idle systems, just get basic process info
|
||||
sys.refresh_processes_specifics(
|
||||
ProcessesToUpdate::All,
|
||||
false,
|
||||
kind,
|
||||
);
|
||||
sys.refresh_processes_specifics(ProcessesToUpdate::All, false, kind);
|
||||
sys.refresh_cpu_usage();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user