From b1e261a925bd607ae0c9ad472de8082efa7752f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 15:53:38 +0800 Subject: [PATCH] chore(deps): Bump sysinfo from 0.29.10 to 0.30.0 (#14138) Signed-off-by: dependabot[bot] Signed-off-by: Richard Chien Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richard Chien --- Cargo.lock | 29 +++++++++++++++++++++++----- src/common/Cargo.toml | 2 +- src/common/src/telemetry/mod.rs | 15 +++++--------- src/common/src/util/resource_util.rs | 2 +- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6055509d0a06a..b6b6ba743eed8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4189,7 +4189,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows", + "windows 0.48.0", ] [[package]] @@ -4678,7 +4678,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows 0.48.0", ] [[package]] @@ -11023,16 +11023,16 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sysinfo" -version = "0.29.10" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a18d114d420ada3a891e6bc8e96a2023402203296a47cdd65083377dad18ba5" +checksum = "c68492e7268037de59ae153d7efb79546cf94a18a9548235420d3d8d2436b4b1" dependencies = [ "cfg-if", "core-foundation-sys", "libc", "ntapi", "once_cell", - "winapi", + "windows 0.51.1", ] [[package]] @@ -12162,6 +12162,25 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.45.0" diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index f47d32862cc42..02f0a9bdda539 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -93,7 +93,7 @@ speedate = "0.13.0" static_assertions = "1" strum = "0.25" strum_macros = "0.25" -sysinfo = { version = "0.29", default-features = false } +sysinfo = { version = "0.30", default-features = false } thiserror = "1" thiserror-ext = { workspace = true } tinyvec = { version = "1", features = ["rustc_1_55", "grab_spare_slice"] } diff --git a/src/common/src/telemetry/mod.rs b/src/common/src/telemetry/mod.rs index 42d6ef1eaafcf..092baa465c7f2 100644 --- a/src/common/src/telemetry/mod.rs +++ b/src/common/src/telemetry/mod.rs @@ -18,7 +18,7 @@ pub mod report; use std::time::SystemTime; use serde::{Deserialize, Serialize}; -use sysinfo::{System, SystemExt}; +use sysinfo::System; use thiserror_ext::AsReport; use crate::util::env_var::env_var_is_true_or; @@ -95,21 +95,16 @@ struct Cpu { impl SystemData { pub fn new() -> Self { - let mut sys = System::new(); - let memory = { let total = system_memory_available_bytes(); let used = total_memory_used_bytes(); Memory { used, total } }; - let os = { - sys.refresh_system(); - Os { - name: sys.name().unwrap_or_default(), - kernel_version: sys.kernel_version().unwrap_or_default(), - version: sys.os_version().unwrap_or_default(), - } + let os = Os { + name: System::name().unwrap_or_default(), + kernel_version: System::kernel_version().unwrap_or_default(), + version: System::os_version().unwrap_or_default(), }; let cpu = Cpu { diff --git a/src/common/src/util/resource_util.rs b/src/common/src/util/resource_util.rs index 3a3825a14e95e..d97182e062666 100644 --- a/src/common/src/util/resource_util.rs +++ b/src/common/src/util/resource_util.rs @@ -132,7 +132,7 @@ mod runtime { } pub mod memory { - use sysinfo::{System, SystemExt}; + use sysinfo::System; use super::runtime::get_resource;