Update sysinfo requirement from 0.32.0 to 0.33.0 (#16851)
# Objective - Fixes #16722 ## Solution - Replaced renamed methods to migrate `sysinfo` properly to 0.33.0. ## Testing - CI checks are passing now. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
21195a75e6
commit
9b2ef6c1c0
@ -27,14 +27,14 @@ const-fnv1a-hash = "1.1.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.32.0", optional = true, default-features = false, features = [
|
||||
sysinfo = { version = "0.33.0", optional = true, default-features = false, features = [
|
||||
"apple-app-store",
|
||||
"system",
|
||||
] }
|
||||
|
||||
# Only include when on linux/windows/android/freebsd
|
||||
[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "android", target_os = "freebsd"))'.dependencies]
|
||||
sysinfo = { version = "0.32.0", optional = true, default-features = false, features = [
|
||||
sysinfo = { version = "0.33.0", optional = true, default-features = false, features = [
|
||||
"system",
|
||||
] }
|
||||
|
||||
|
@ -108,8 +108,8 @@ pub mod internal {
|
||||
) {
|
||||
let sysinfo = sysinfo.get_or_insert_with(|| {
|
||||
Arc::new(Mutex::new(System::new_with_specifics(
|
||||
RefreshKind::new()
|
||||
.with_cpu(CpuRefreshKind::new().with_cpu_usage())
|
||||
RefreshKind::nothing()
|
||||
.with_cpu(CpuRefreshKind::nothing().with_cpu_usage())
|
||||
.with_memory(MemoryRefreshKind::everything()),
|
||||
)))
|
||||
});
|
||||
@ -129,7 +129,7 @@ pub mod internal {
|
||||
let task = thread_pool.spawn(async move {
|
||||
let mut sys = sys.lock().unwrap();
|
||||
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage());
|
||||
sys.refresh_cpu_specifics(CpuRefreshKind::nothing().with_cpu_usage());
|
||||
sys.refresh_memory();
|
||||
let current_cpu_usage = sys.global_cpu_usage().into();
|
||||
// `memory()` fns return a value in bytes
|
||||
@ -166,9 +166,9 @@ pub mod internal {
|
||||
impl Default for SystemInfo {
|
||||
fn default() -> Self {
|
||||
let sys = System::new_with_specifics(
|
||||
RefreshKind::new()
|
||||
.with_cpu(CpuRefreshKind::new())
|
||||
.with_memory(MemoryRefreshKind::new().with_ram()),
|
||||
RefreshKind::nothing()
|
||||
.with_cpu(CpuRefreshKind::nothing())
|
||||
.with_memory(MemoryRefreshKind::nothing().with_ram()),
|
||||
);
|
||||
|
||||
let system_info = SystemInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user