@@ -12,7 +12,7 @@ use std::cell::RefCell;
12
12
use std:: fs:: File ;
13
13
use std:: io:: BufWriter ;
14
14
use std:: time:: { Duration , Instant } ;
15
- use sysinfo:: { ProcessorExt , System , SystemExt } ;
15
+ use sysinfo:: { CpuExt , System , SystemExt } ;
16
16
17
17
pub ( crate ) struct BuildMetrics {
18
18
state : RefCell < MetricsState > ,
@@ -79,7 +79,7 @@ impl BuildMetrics {
79
79
step. duration_excluding_children_sec += elapsed;
80
80
81
81
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 > ( ) ;
83
83
step. cpu_usage_time_sec += cpu as f64 / 100.0 * elapsed. as_secs_f64 ( ) ;
84
84
}
85
85
@@ -94,8 +94,8 @@ impl BuildMetrics {
94
94
system. refresh_memory ( ) ;
95
95
96
96
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 ( ) ,
99
99
100
100
memory_total_bytes : system. total_memory ( ) * 1024 ,
101
101
} ;
0 commit comments