bump sysinfo version
This commit is contained in:
parent
836b2d2dbb
commit
70cdd7efc3
@ -5060,9 +5060,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sysinfo"
|
||||
version = "0.23.11"
|
||||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3bf915673a340ee41f2fc24ad1286c75ea92026f04b65a0d0e5132d80b95fc61"
|
||||
checksum = "a6a8e71535da31837213ac114531d31def75d7aebd133264e420a3451fa7f703"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"core-foundation-sys",
|
||||
|
@ -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"
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user