From 5ed2c7fad52aeab180f1a1b719a99b85d01846e5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 23 Dec 2023 00:25:25 +0100 Subject: [PATCH] Update sysinfo version to 0.30.0 --- crates/bevy_diagnostic/Cargo.toml | 4 ++-- .../src/system_information_diagnostics_plugin.rs | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/crates/bevy_diagnostic/Cargo.toml b/crates/bevy_diagnostic/Cargo.toml index dec3647ce9b6c..034f04ddcd909 100644 --- a/crates/bevy_diagnostic/Cargo.toml +++ b/crates/bevy_diagnostic/Cargo.toml @@ -24,13 +24,13 @@ bevy_utils = { path = "../bevy_utils", version = "0.12.0" } # MacOS [target.'cfg(all(target_os="macos"))'.dependencies] # Some features of sysinfo are not supported by apple. This will disable those features on apple devices -sysinfo = { version = "0.29.0", default-features = false, features = [ +sysinfo = { version = "0.30.0", default-features = false, features = [ "apple-app-store", ] } # Only include when not bevy_dynamic_plugin and on linux/windows/android [target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "android"))'.dependencies] -sysinfo = { version = "0.29.0", default-features = false } +sysinfo = { version = "0.30.0", default-features = false } [lints] workspace = true diff --git a/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs index 46c39a27977ff..c0265f48972ed 100644 --- a/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs @@ -43,7 +43,7 @@ impl SystemInformationDiagnosticsPlugin { pub mod internal { use bevy_ecs::{prelude::ResMut, system::Local}; use bevy_log::info; - use sysinfo::{CpuExt, CpuRefreshKind, RefreshKind, System, SystemExt}; + use sysinfo::{CpuRefreshKind, MemoryRefreshKind, RefreshKind, System}; use crate::{Diagnostic, Diagnostics, DiagnosticsStore}; @@ -76,7 +76,7 @@ pub mod internal { *sysinfo = Some(System::new_with_specifics( RefreshKind::new() .with_cpu(CpuRefreshKind::new().with_cpu_usage()) - .with_memory(), + .with_memory(MemoryRefreshKind::everything()), )); } let Some(sys) = sysinfo.as_mut() else { @@ -116,12 +116,8 @@ pub mod internal { sys.refresh_memory(); let info = SystemInfo { - os: sys - .long_os_version() - .unwrap_or_else(|| String::from("not available")), - kernel: sys - .kernel_version() - .unwrap_or_else(|| String::from("not available")), + os: System::long_os_version().unwrap_or_else(|| String::from("not available")), + kernel: System::kernel_version().unwrap_or_else(|| String::from("not available")), cpu: sys.global_cpu_info().brand().trim().to_string(), core_count: sys .physical_core_count()