Skip to content

Commit 70cdd7e

Browse files
committed
bump sysinfo version
1 parent 836b2d2 commit 70cdd7e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -5060,9 +5060,9 @@ dependencies = [
50605060

50615061
[[package]]
50625062
name = "sysinfo"
5063-
version = "0.23.11"
5063+
version = "0.24.1"
50645064
source = "registry+https://github.com/rust-lang/crates.io-index"
5065-
checksum = "3bf915673a340ee41f2fc24ad1286c75ea92026f04b65a0d0e5132d80b95fc61"
5065+
checksum = "a6a8e71535da31837213ac114531d31def75d7aebd133264e420a3451fa7f703"
50665066
dependencies = [
50675067
"cfg-if 1.0.0",
50685068
"core-foundation-sys",

src/bootstrap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ once_cell = "1.7.2"
5050
xz2 = "0.1"
5151

5252
# Dependencies needed by the build-metrics feature
53-
sysinfo = { version = "0.23.0", optional = true }
53+
sysinfo = { version = "0.24.1", optional = true }
5454

5555
[target.'cfg(windows)'.dependencies.winapi]
5656
version = "0.3"

src/bootstrap/metrics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::cell::RefCell;
1212
use std::fs::File;
1313
use std::io::BufWriter;
1414
use std::time::{Duration, Instant};
15-
use sysinfo::{ProcessorExt, System, SystemExt};
15+
use sysinfo::{CpuExt, System, SystemExt};
1616

1717
pub(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

Comments
 (0)