diff options
author | Dan Davison <dandavison7@gmail.com> | 2021-12-11 15:31:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-11 15:31:34 -0500 |
commit | 69c7aaa28fdda955cf430134170e3a533970cc0f (patch) | |
tree | 55d68bb4f93e2c63d77f30d0ede49d8d643ab853 | |
parent | 5c1612ec0ad328249a611933cf7d13b05a99680a (diff) |
Do not query CPU data when querying process data (#845)
* Do not query CPU data when querying process data
Fixes #839
Ref https://github.com/GuillaumeGomez/sysinfo/issues/632
* Update branch of sysinfo
* Update upstream sysinfo commit
Ref https://github.com/GuillaumeGomez/sysinfo/pull/636
* Point sysinfo at an explicit commit rather than a symbolic branch name
commit d647acfbf216848a8237e1f9251b2c48860a547f
Merge: 989ac6c 67a586c
Author: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date: 2 hours ago
Merge pull request #636 from GuillaumeGomez/update-if-needed
Only update processors if needed
-rw-r--r-- | Cargo.lock | 5 | ||||
-rw-r--r-- | Cargo.toml | 3 | ||||
-rw-r--r-- | src/utils/process.rs | 8 |
3 files changed, 9 insertions, 7 deletions
@@ -1053,9 +1053,8 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.20.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e223c65cd36b485a34c2ce6e38efa40777d31c4166d9076030c74cdcf971679f" +version = "0.21.2" +source = "git+https://github.com/GuillaumeGomez/sysinfo#d647acfbf216848a8237e1f9251b2c48860a547f" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys", @@ -53,7 +53,8 @@ default-features = false features = ["parsing", "assets", "yaml-load", "dump-load", "regex-onig"] [dependencies.sysinfo] -version = "0.20.5" +git = "https://github.com/GuillaumeGomez/sysinfo" +commit = "d647acfbf216848a8237e1f9251b2c48860a547f" # no default features to disable the use of threads default-features = false features = [] diff --git a/src/utils/process.rs b/src/utils/process.rs index 5602dd3f..68b57a6a 100644 --- a/src/utils/process.rs +++ b/src/utils/process.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::path::Path; -use sysinfo::{Pid, Process, ProcessExt, SystemExt}; +use sysinfo::{Pid, Process, ProcessExt, ProcessRefreshKind, SystemExt}; use lazy_static::lazy_static; @@ -347,7 +347,8 @@ impl ProcessInterface for ProcInfo { std::process::id() as Pid } fn refresh_process(&mut self, pid: Pid) -> bool { - self.info.refresh_process(pid) + self.info + .refresh_process_specifics(pid, ProcessRefreshKind::new()) } fn process(&self, pid: Pid) -> Option<&Self::Out> { self.info.process(pid) @@ -356,7 +357,8 @@ impl ProcessInterface for ProcInfo { self.info.processes() } fn refresh_processes(&mut self) { - self.info.refresh_processes() + self.info + .refresh_processes_specifics(ProcessRefreshKind::new()) } } |