diff --git a/socktop_agent/src/metrics.rs b/socktop_agent/src/metrics.rs index 2dbc149..5de7e21 100644 --- a/socktop_agent/src/metrics.rs +++ b/socktop_agent/src/metrics.rs @@ -441,10 +441,10 @@ pub async fn collect_processes_all(state: &AppState) -> ProcessesPayload { sleep(Duration::from_millis(200)).await; // Second refresh: only CPU counters (lighter than full everything) to reduce overhead. let (total_count, procs) = { - let mut sys = state.sys.lock().await; - // Build a lightweight refresh kind: only CPU times. - let cpu_only = ProcessRefreshKind::nothing().with_cpu(); - sys.refresh_processes_specifics(ProcessesToUpdate::All, false, cpu_only); + let mut sys = state.sys.lock().await; + // Build a lightweight refresh kind: only CPU times. + let cpu_only = ProcessRefreshKind::nothing().with_cpu(); + sys.refresh_processes_specifics(ProcessesToUpdate::All, false, cpu_only); let total_count = sys.processes().len(); let norm = normalize_cpu_enabled(); let cores = if norm {