Update sysinfo version to 0.30.0 (#11071)

New version comes with a lot of improvements. Full list is available
there:
https://github.com/GuillaumeGomez/sysinfo/blob/master/migration_guide.md
This commit is contained in:
Guillaume Gomez 2023-12-23 18:33:15 +01:00 committed by GitHub
parent 22acd62dbf
commit e360763b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 10 deletions

View File

@ -24,13 +24,13 @@ bevy_utils = { path = "../bevy_utils", version = "0.12.0" }
# MacOS # MacOS
[target.'cfg(all(target_os="macos"))'.dependencies] [target.'cfg(all(target_os="macos"))'.dependencies]
# Some features of sysinfo are not supported by apple. This will disable those features on apple devices # 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", "apple-app-store",
] } ] }
# Only include when not bevy_dynamic_plugin and on linux/windows/android # 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] [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] [lints]
workspace = true workspace = true

View File

@ -43,7 +43,7 @@ impl SystemInformationDiagnosticsPlugin {
pub mod internal { pub mod internal {
use bevy_ecs::{prelude::ResMut, system::Local}; use bevy_ecs::{prelude::ResMut, system::Local};
use bevy_log::info; use bevy_log::info;
use sysinfo::{CpuExt, CpuRefreshKind, RefreshKind, System, SystemExt}; use sysinfo::{CpuRefreshKind, MemoryRefreshKind, RefreshKind, System};
use crate::{Diagnostic, Diagnostics, DiagnosticsStore}; use crate::{Diagnostic, Diagnostics, DiagnosticsStore};
@ -76,7 +76,7 @@ pub mod internal {
*sysinfo = Some(System::new_with_specifics( *sysinfo = Some(System::new_with_specifics(
RefreshKind::new() RefreshKind::new()
.with_cpu(CpuRefreshKind::new().with_cpu_usage()) .with_cpu(CpuRefreshKind::new().with_cpu_usage())
.with_memory(), .with_memory(MemoryRefreshKind::everything()),
)); ));
} }
let Some(sys) = sysinfo.as_mut() else { let Some(sys) = sysinfo.as_mut() else {
@ -116,12 +116,8 @@ pub mod internal {
sys.refresh_memory(); sys.refresh_memory();
let info = SystemInfo { let info = SystemInfo {
os: sys os: System::long_os_version().unwrap_or_else(|| String::from("not available")),
.long_os_version() kernel: System::kernel_version().unwrap_or_else(|| String::from("not available")),
.unwrap_or_else(|| String::from("not available")),
kernel: sys
.kernel_version()
.unwrap_or_else(|| String::from("not available")),
cpu: sys.global_cpu_info().brand().trim().to_string(), cpu: sys.global_cpu_info().brand().trim().to_string(),
core_count: sys core_count: sys
.physical_core_count() .physical_core_count()