@@ -328,33 +328,33 @@ impl LifecycleManager {
328328 async fn get_process_stats ( & self , pid : i32 ) -> Result < ( u64 , f32 ) > {
329329 // Create a new System instance with all information
330330 let mut system = System :: new_all ( ) ;
331-
331+
332332 // Convert i32 pid to sysinfo::Pid
333333 let sys_pid = sysinfo:: Pid :: from ( pid as usize ) ;
334-
334+
335335 // Make sure we're refreshing CPU information
336336 system. refresh_cpu ( ) ;
337337 system. refresh_processes ( ) ;
338-
338+
339339 // First refresh to get initial CPU values
340340 system. refresh_all ( ) ;
341-
341+
342342 // Wait longer for CPU measurement (500ms instead of 100ms)
343343 sleep ( std:: time:: Duration :: from_millis ( 500 ) ) . await ;
344-
344+
345345 // Refresh again to get updated CPU values
346346 system. refresh_cpu ( ) ;
347347 system. refresh_processes ( ) ;
348348 system. refresh_all ( ) ;
349-
349+
350350 // Get the process
351351 if let Some ( process) = system. process ( sys_pid) {
352352 // Get memory in bytes
353353 let memory_usage = process. memory ( ) ;
354-
354+
355355 // Get CPU usage as percentage
356356 let cpu_usage = process. cpu_usage ( ) ;
357-
357+
358358 Ok ( ( memory_usage, cpu_usage) )
359359 } else {
360360 // Process not found
@@ -366,18 +366,18 @@ impl LifecycleManager {
366366 async fn get_child_process_stats ( & self , parent_pid : i32 ) -> Result < Vec < ProcessStats > > {
367367 // Create a new System instance with all processes information
368368 let mut system = System :: new_all ( ) ;
369-
369+
370370 // Make sure we're refreshing CPU information
371371 system. refresh_cpu ( ) ;
372372 system. refresh_processes ( ) ;
373373 system. refresh_all ( ) ;
374-
374+
375375 // Convert i32 pid to sysinfo::Pid
376376 let sys_pid = sysinfo:: Pid :: from ( parent_pid as usize ) ;
377-
377+
378378 // Wait longer for CPU measurement (500ms instead of 100ms)
379379 sleep ( std:: time:: Duration :: from_millis ( 500 ) ) . await ;
380-
380+
381381 // Refresh all system information to get updated CPU values
382382 system. refresh_cpu ( ) ;
383383 system. refresh_processes ( ) ;
0 commit comments