diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2022-06-04 18:59:07 +0200 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2022-06-04 18:59:07 +0200 |
| commit | 70cdd7efc3ab10834dfbfc9a00884388a72a6544 (patch) | |
| tree | 4cd3b1a027aa79fb9383551424883d60941906ef /src/bootstrap | |
| parent | 836b2d2dbb0ad5ae4da2c6ae92d2de535ad77da3 (diff) | |
| download | rust-70cdd7efc3ab10834dfbfc9a00884388a72a6544.tar.gz rust-70cdd7efc3ab10834dfbfc9a00884388a72a6544.zip | |
bump sysinfo version
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/bootstrap/metrics.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index d4c6f927df0..5027a45e0ad 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -50,7 +50,7 @@ once_cell = "1.7.2" xz2 = "0.1" # Dependencies needed by the build-metrics feature -sysinfo = { version = "0.23.0", optional = true } +sysinfo = { version = "0.24.1", optional = true } [target.'cfg(windows)'.dependencies.winapi] version = "0.3" diff --git a/src/bootstrap/metrics.rs b/src/bootstrap/metrics.rs index 56a79e99b7c..451febddc88 100644 --- a/src/bootstrap/metrics.rs +++ b/src/bootstrap/metrics.rs @@ -12,7 +12,7 @@ use std::cell::RefCell; use std::fs::File; use std::io::BufWriter; use std::time::{Duration, Instant}; -use sysinfo::{ProcessorExt, System, SystemExt}; +use sysinfo::{CpuExt, System, SystemExt}; pub(crate) struct BuildMetrics { state: RefCell<MetricsState>, @@ -79,7 +79,7 @@ impl BuildMetrics { step.duration_excluding_children_sec += elapsed; state.system_info.refresh_cpu(); - let cpu = state.system_info.processors().iter().map(|p| p.cpu_usage()).sum::<f32>(); + let cpu = state.system_info.cpus().iter().map(|p| p.cpu_usage()).sum::<f32>(); step.cpu_usage_time_sec += cpu as f64 / 100.0 * elapsed.as_secs_f64(); } @@ -94,8 +94,8 @@ impl BuildMetrics { system.refresh_memory(); let system_stats = JsonInvocationSystemStats { - cpu_threads_count: system.processors().len(), - cpu_model: system.processors()[0].brand().into(), + cpu_threads_count: system.cpus().len(), + cpu_model: system.cpus()[0].brand().into(), memory_total_bytes: system.total_memory() * 1024, }; |
