@@ -12,7 +12,7 @@ use std::cell::RefCell;
1212use std:: fs:: File ;
1313use std:: io:: BufWriter ;
1414use std:: time:: { Duration , Instant } ;
15- use sysinfo:: { ProcessorExt , System , SystemExt } ;
15+ use sysinfo:: { CpuExt , System , SystemExt } ;
1616
1717pub ( crate ) struct BuildMetrics {
1818 state : RefCell < MetricsState > ,
@@ -79,7 +79,7 @@ impl BuildMetrics {
7979 step. duration_excluding_children_sec += elapsed;
8080
8181 state. system_info . refresh_cpu ( ) ;
82- let cpu = state. system_info . processors ( ) . iter ( ) . map ( |p| p. cpu_usage ( ) ) . sum :: < f32 > ( ) ;
82+ let cpu = state. system_info . cpus ( ) . iter ( ) . map ( |p| p. cpu_usage ( ) ) . sum :: < f32 > ( ) ;
8383 step. cpu_usage_time_sec += cpu as f64 / 100.0 * elapsed. as_secs_f64 ( ) ;
8484 }
8585
@@ -94,8 +94,8 @@ impl BuildMetrics {
9494 system. refresh_memory ( ) ;
9595
9696 let system_stats = JsonInvocationSystemStats {
97- cpu_threads_count : system. processors ( ) . len ( ) ,
98- cpu_model : system. processors ( ) [ 0 ] . brand ( ) . into ( ) ,
97+ cpu_threads_count : system. cpus ( ) . len ( ) ,
98+ cpu_model : system. cpus ( ) [ 0 ] . brand ( ) . into ( ) ,
9999
100100 memory_total_bytes : system. total_memory ( ) * 1024 ,
101101 } ;
0 commit comments