commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
368a8ff3c4d2028aa07971959e030234f340077f | Guillaume Gomez | 2020-07-11T15:14:49 | Improve process name retrieval | diff --git a/src/linux/system.rs b/src/linux/system.rs
index d2083f2..136f5ee 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -19,7 +19,7 @@ use {ProcessExt, RefreshKind, SystemExt};
use libc::{self, gid_t, sysconf, uid_t, _SC_CLK_TCK, _SC_PAGESIZE};
use std::cell::UnsafeCell;
use std::collections::Has... | 1 | 39 | 10 |
b01cb59dce5ab3c4da18488565bd2d2fa1e4aa83 | Guillaume Gomez | 2020-07-11T13:05:11 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index dc42879..364bb3b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.11"
+version = "0.14.12"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, p... | 1 | 1 | 1 |
c7db57b17f9d129b62eba5c7b4071c8068cf8525 | Tshepang Lekhonkhobe | 2020-07-10T22:49:15 | Prevent infinite recursion when getting disk (part 2)
See also #325 | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index 0a00eb7..994cba1 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -114,7 +114,9 @@ fn find_type_for_name(name: &OsStr) -> DiskType {
let mut real_path = real_path.to_str().unwrap_or_default();
if name_path.starts_with("/dev/mapper/") {
... | 1 | 3 | 1 |
154edaf66e97666bfacae607f56147f8fb42b01b | Guillaume Gomez | 2020-07-10T08:39:08 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 21b921c..dc42879 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.10"
+version = "0.14.11"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, p... | 1 | 1 | 1 |
4c2f2dd85d8ee0d3d827532c126114e5a2085aa8 | Guillaume Gomez | 2020-07-06T18:54:43 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index c4ffd73..21b921c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.9"
+version = "0.14.10"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pr... | 1 | 1 | 1 |
adf53e483c47442433b9da8ee274b1a7b58e0739 | Guillaume Gomez | 2020-07-06T18:54:29 | Simplify DiskType and remove the From<isize> implementation | diff --git a/src/common.rs b/src/common.rs
index 2447c6e..fe85778 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -257,16 +257,6 @@ pub enum DiskType {
Unknown(isize),
}
-impl From<isize> for DiskType {
- fn from(t: isize) -> DiskType {
- match t {
- 0 => DiskType::SSD,
- 1 => ... | 2 | 10 | 12 |
3ba32d5afa61c14229930b6b31e0ea9235b4a657 | Olivier Darrouzet | 2020-07-06T18:05:16 | Bug: right detection of SSD or HDD disk.
DiskType::from use the value of /sys/block/<device>/queue/rotational to guess if a mounted device is an SSD
or a HDD.
1 means HDD, and 0 SSD.
Ignore the devtmpfs filesystem, it is the pseudo filesystem used /dev directory. | diff --git a/src/common.rs b/src/common.rs
index 93f154f..2447c6e 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -260,8 +260,8 @@ pub enum DiskType {
impl From<isize> for DiskType {
fn from(t: isize) -> DiskType {
match t {
- 0 => DiskType::HDD,
- 1 => DiskType::SSD,
+ ... | 2 | 3 | 2 |
100fbe8f99ed0ba330b331dde2ef359f6a0f4771 | Guillaume Gomez | 2020-07-03T21:04:41 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index a9faa14..c4ffd73 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.8"
+version = "0.14.9"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
6f7f13efc769b719b463b66a62a11cf5ab2f23f3 | Guillaume Gomez | 2020-07-03T21:04:29 | Improve processor usage computation | diff --git a/src/linux/processor.rs b/src/linux/processor.rs
index 3d3bd0c..3cd635e 100644
--- a/src/linux/processor.rs
+++ b/src/linux/processor.rs
@@ -104,19 +104,16 @@ impl CpuValues {
/// Returns work time.
pub fn work_time(&self) -> u64 {
- self.user + self.nice + self.system
+ self.user ... | 1 | 20 | 20 |
0ba531278d10671deb9ff4539a7da91a0313c8e3 | Guillaume Gomez | 2020-07-03T21:04:17 | Fix info retrieval for global processor | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 0340e48..1f11768 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -174,7 +174,6 @@ impl System {
let first = self.processors.is_empty();
let mut it = buf.split(b'\n');
let mut count = 0;
- let fre... | 1 | 5 | 4 |
e83289ac95ebe46e376eb35905e5f9f84b6dabae | Ammar Askar | 2020-07-02T20:52:55 | Fix load average constants on windows
There was an error in the parenthesis during the calculation of this constant, fixing this in the downstream projects where it got propagated to. See
https://github.com/giampaolo/psutil/issues/1552
https://github.com/giampaolo/psutil/pull/1583 | diff --git a/src/windows/processor.rs b/src/windows/processor.rs
index c3b841d..7a10204 100644
--- a/src/windows/processor.rs
+++ b/src/windows/processor.rs
@@ -33,8 +33,8 @@ use winapi::um::winnt::{ProcessorInformation, BOOLEAN, HANDLE, PVOID, WT_EXECUTE
// This formula comes from linux's include/linux/sched/loadavg.... | 1 | 2 | 2 |
3bd28fc1d69abf871d413282b1a7637528caf215 | Guillaume Gomez | 2020-07-02T10:56:44 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index e76e0e1..a9faa14 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.7"
+version = "0.14.8"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
0adcd1d566def92a5870e08b9e6d9741c1a23bde | odarrouzet | 2020-07-02T10:55:44 | Bug: usize on 32bit OS is too small (#335)
* Bug: usize on 32bit OS is too small
The statistics for network interfaces are 64bit numbers on linux, even
if the OS is 32bit. Using usize for theses statistics work only if the
current host has not transfered less than 4GB.
* formating: remove double blankds | diff --git a/src/linux/network.rs b/src/linux/network.rs
index e31ecf4..3b5bb0b 100644
--- a/src/linux/network.rs
+++ b/src/linux/network.rs
@@ -37,7 +37,7 @@ macro_rules! old_and_new {
}};
}
-fn read<P: AsRef<Path>>(parent: P, path: &str, data: &mut Vec<u8>) -> usize {
+fn read<P: AsRef<Path>>(parent: P, path:... | 1 | 26 | 26 |
c6807cfcc200f3f97a57c8e27804966783e911c4 | arctic-alpaca | 2020-06-28T11:19:40 | Added individual core frequency to Linux | diff --git a/src/linux/processor.rs b/src/linux/processor.rs
index e89062e..3d3bd0c 100644
--- a/src/linux/processor.rs
+++ b/src/linux/processor.rs
@@ -128,7 +128,7 @@ pub struct Processor {
cpu_usage: f32,
total_time: u64,
old_total_time: u64,
- frequency: u64,
+ pub(crate) frequency: u64,
p... | 2 | 13 | 8 |
ce515d25dc1d5362f6a6975112fcf51de87f9aa2 | arctic-alpaca | 2020-06-28T10:53:50 | Read cpu_frequency from scaling_cur_freq (#331)
* Read cpu_frequency from scaling_cur_freq
* Add previous method as fallback
* Reorded to properly handle cases, added string clear inbetween
* Indentation fix
* Changed error checking to get better indentation.
* Removed semicolon | diff --git a/src/linux/processor.rs b/src/linux/processor.rs
index 34ea066..e89062e 100644
--- a/src/linux/processor.rs
+++ b/src/linux/processor.rs
@@ -228,22 +228,31 @@ pub fn get_raw_times(p: &Processor) -> (u64, u64) {
}
pub fn get_cpu_frequency() -> u64 {
- // /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cu... | 1 | 12 | 3 |
d62d86aded6af1f23accd503d346376a80d31472 | Guillaume Gomez | 2020-06-24T12:01:59 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 83e8ba2..e76e0e1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.6"
+version = "0.14.7"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
8d247b0ea2bcbd132b27ee8c91f2d48323b24bba | arctic-alpaca | 2020-06-24T11:28:50 | Removed unnecessary check | diff --git a/src/linux/component.rs b/src/linux/component.rs
index d2945b5..ff6eb6f 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -209,9 +209,5 @@ pub fn get_components() -> Vec<Component> {
None,
));
}
- if components.len() != 0 {
- components
- } else {
- ... | 1 | 1 | 5 |
dc57a7bd874c63b562beb570bbbe5ab97b10f789 | arctic-alpaca | 2020-06-24T10:21:25 | Fix no temperature on Raspberry Pi | diff --git a/src/linux/component.rs b/src/linux/component.rs
index 4985b17..d2945b5 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -180,9 +180,8 @@ impl ComponentExt for Component {
}
pub fn get_components() -> Vec<Component> {
+ let mut components = Vec::with_capacity(10);
if let Ok(di... | 1 | 8 | 6 |
8a231d1443dbc8d05083a86c47b667094116f141 | Guillaume Gomez | 2020-06-24T09:48:42 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 72d777c..83e8ba2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.5"
+version = "0.14.6"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
1cf8e1c4addf394ee2ea8657fff53a1db342f633 | Guillaume Gomez | 2020-06-24T08:49:02 | Prevent infinite recursion when getting disk | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index ce82af6..76eb712 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -126,7 +126,9 @@ fn find_type_for_name(name: &OsStr) -> DiskType {
real_path = real_path.trim_end_matches(|c| c == 'p');
} else if name_path.starts_with("/dev/root") {
... | 1 | 3 | 1 |
897bc828a6826d7f8121f189ac386bab1a66bf0f | Guillaume Gomez | 2020-06-04T08:20:00 | Upgrade crate version | diff --git a/Cargo.toml b/Cargo.toml
index 4e25b26..72d777c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.4"
+version = "0.14.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
e7e36bc2d58d725e6c1058e982af45274e858212 | Guillaume Gomez | 2020-06-01T11:26:44 | Strenghten cfg check: use linux and android instead of unix | diff --git a/src/sysinfo.rs b/src/sysinfo.rs
index 5666873..97e83f1 100644
--- a/src/sysinfo.rs
+++ b/src/sysinfo.rs
@@ -92,7 +92,7 @@ cfg_if! {
#[cfg(test)]
const MIN_USERS: usize = 1;
- } else if #[cfg(unix)] {
+ } else if #[cfg(any(target_os = "linux", target_os = "android"))] {
mo... | 1 | 3 | 3 |
53adf14da7d9fa9e9d719aa7b0f46402d91fc5cf | Guillaume Gomez | 2020-05-27T07:41:02 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index c1d7254..4e25b26 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.3"
+version = "0.14.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
ba41e762d02f25563536993f306f089bcb8ef38c | YKG | 2020-05-27T04:33:35 | Fix memory used calculation | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 6224534..4011fc8 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -132,7 +132,8 @@ pub struct System {
mem_total: u64,
mem_free: u64,
mem_buffers: u64,
- mem_cache: u64,
+ mem_page_cache: u64,
+ mem_slab_reclaimable: u64,
... | 1 | 7 | 4 |
89e978253687b944bfd757c0a57745894de7ad97 | Guillaume Gomez | 2020-05-25T18:47:12 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 5bd09d4..c1d7254 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.2"
+version = "0.14.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
60d933f8f5816bc4d02563d04a447bf800648b73 | YKG | 2020-05-25T08:41:27 | fix memory usage in linux platform | diff --git a/src/linux/system.rs b/src/linux/system.rs
index b1af0a0..6224534 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -131,6 +131,8 @@ pub struct System {
process_list: Process,
mem_total: u64,
mem_free: u64,
+ mem_buffers: u64,
+ mem_cache: u64,
swap_total: u64,
swa... | 1 | 8 | 2 |
b5825e409467215b5773f9ea997cf2081776369a | Guillaume Gomez | 2020-05-14T18:48:48 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index df95940..5bd09d4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.1"
+version = "0.14.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
fcd5bf3dd2bf81ea8515ba6ee3861e7085257f2c | Guillaume Gomez | 2020-05-14T14:30:38 | Fix compute_cpu overflow on windows | diff --git a/src/windows/process.rs b/src/windows/process.rs
index a9e9086..a6d7e91 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -705,6 +705,15 @@ pub(crate) fn get_system_computation_time() -> ULARGE_INTEGER {
}
}
+#[inline]
+fn check_sub(a: u64, b: u64) -> u64 {
+ if a < b {
+ ... | 1 | 12 | 3 |
da900c8ef9f2be19b8ad32062b7a136869445706 | Guillaume Gomez | 2020-05-14T14:22:40 | Fix compute_cpu_usage underflow error on mac | diff --git a/src/mac/process.rs b/src/mac/process.rs
index 9826a3e..2606514 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -325,8 +325,16 @@ impl ProcessExt for Process {
}
pub(crate) fn compute_cpu_usage(p: &mut Process, time: u64, task_time: u64) {
- let system_time_delta = task_time - p.old_utime... | 1 | 10 | 2 |
3ed770bedade2a026d00fec80d988bcdb520f8b5 | Alexandru Macovei | 2020-05-05T08:17:27 | Silence clippy warning for Mutex using a single value | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 1149daf..b1af0a0 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -30,8 +30,9 @@ use utils::realpath;
use rayon::prelude::*;
-// This whole thing is to prevent having too much files open at once. It could be problematic
+// This whole thing ... | 1 | 2 | 1 |
7f54af65acea9fbcf4dfdccc2f58900c101abb28 | Alexandru Macovei | 2020-05-05T07:07:40 | Apply clippy lint for if_chain => match | diff --git a/src/linux/processor.rs b/src/linux/processor.rs
index df2027d..34ea066 100644
--- a/src/linux/processor.rs
+++ b/src/linux/processor.rs
@@ -179,12 +179,11 @@ impl Processor {
guest_nice: u64,
) {
fn min(a: u64, b: u64) -> f32 {
- (if a == b {
- 1
- ... | 1 | 5 | 6 |
7f6d9a927c8d78c8bbfe943d893a5e9b5930d61d | Alexandru Macovei | 2020-05-05T07:00:54 | Address most clippy lints | diff --git a/src/common.rs b/src/common.rs
index 3fbcf19..93f154f 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -112,7 +112,7 @@ assert_eq!(r.", stringify!($name), "(), false);
/// ```
///
/// [`System`]: crate::System
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+#[derive(Clone, Copy, Debug, Default, PartialEq... | 10 | 19 | 36 |
a2dc8766dfa7f452c91c0751fd21c08a41b5102d | Alexander Larin | 2020-05-03T15:53:16 | Replace lazy_static to once_cell | diff --git a/Cargo.toml b/Cargo.toml
index 7319c31..df95940 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,6 @@ once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "win... | 3 | 22 | 29 |
42de86b05416e76ccb0e1892b0cc84410f6391cb | Alexander Larin | 2020-05-03T15:07:40 | Move lazy_static under cfg(windows) | diff --git a/Cargo.toml b/Cargo.toml
index 379c5af..7319c31 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,11 +17,11 @@ cfg-if = "0.1"
rayon = "^1.0"
doc-comment = "0.3"
once_cell = "1.0"
-lazy_static = "1.4.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", ... | 1 | 1 | 1 |
685b56b3dd91777ce0e6df7d304619d85a32f983 | Alexander Larin | 2020-05-03T13:57:42 | lazy_static for windows version | diff --git a/Cargo.toml b/Cargo.toml
index df95940..379c5af 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,7 @@ cfg-if = "0.1"
rayon = "^1.0"
doc-comment = "0.3"
once_cell = "1.0"
+lazy_static = "1.4.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "i... | 3 | 31 | 1 |
69b51f05ddd1b38de28fdfa44b15f9049cfcd8d4 | Alexander Larin | 2020-05-03T13:18:55 | Fix clippy error | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 752175a..693833f 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -475,6 +475,7 @@ unsafe fn ph_query_process_variable_size(
if !NT_SUCCESS(status) {
return None;
}
+ buffer.push(0);
return Some(buffer);
}
... | 1 | 4 | 1 |
9822a0559ed1333e36fd8c718e9d5ff8047017a4 | Alexander Larin | 2020-05-03T10:25:19 | New get_cmd_line windows approach | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 2119d49..752175a 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -19,9 +19,14 @@ use Pid;
use ProcessExt;
use ntapi::ntpsapi::{
- NtQueryInformationProcess, ProcessBasicInformation, PROCESS_BASIC_INFORMATION,
+ NtQueryInfor... | 1 | 86 | 21 |
cf2897564c541629d160d99031d8cb838af63ff9 | Guillaume Gomez | 2020-04-18T14:20:33 | Comment disks test for the moment | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index 1a8b4fd..46c255c 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -199,37 +199,37 @@ pub fn get_all_disks() -> Vec<Disk> {
get_all_disks_inner(&get_all_data("/proc/mounts", 16_385).unwrap_or_default())
}
-#[test]
-fn check_all_disks() {
- let ... | 1 | 34 | 34 |
18e0414568e93018250cf3aa85be9f62635673dc | Guillaume Gomez | 2020-04-18T13:39:13 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 556496e..df95940 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.14.0"
+version = "0.14.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
8e3ccf7950c309cd93f415f3ff906b0abf7a5ca1 | Guillaume Gomez | 2020-04-18T13:38:46 | Don't list Disks with 0 as total size | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index b0c6c40..1a8b4fd 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -73,7 +73,7 @@ impl DiskExt for Disk {
}
}
-fn new_disk(name: &OsStr, mount_point: &Path, file_system: &[u8]) -> Disk {
+fn new_disk(name: &OsStr, mount_point: &Path, file_system: ... | 4 | 24 | 21 |
a5f722d50605865079bbfbec311778a14542e652 | Guillaume Gomez | 2020-04-18T11:21:00 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index df86ec1..556496e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.4"
+version = "0.14.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
78ebfcc42d67e4460a34fc87b40042b82520f43e | Guillaume Gomez | 2020-04-18T11:20:42 | Update units from KiB to kB | diff --git a/src/mac/process.rs b/src/mac/process.rs
index db7dd04..9826a3e 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -408,8 +408,8 @@ pub(crate) fn update_process(
let time = ffi::mach_absolute_time();
compute_cpu_usage(p, time, task_time);
- p.memory = task_inf... | 5 | 38 | 38 |
e334fcf5cbcfd87e7576177f0e45dbf50cd5477b | Guillaume Gomez | 2020-04-17T23:11:41 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 4f25d3a..df86ec1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.3"
+version = "0.13.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
88d88858bfdef0172613f68e6d8bbf381751823a | Guillaume Gomez | 2020-04-17T23:11:09 | Improve a bit the disk I/O process usage getter | diff --git a/src/linux/process.rs b/src/linux/process.rs
index fbeaacd..1ecd121 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -276,11 +276,11 @@ pub(crate) fn update_process_disk_activity(p: &mut Process, path: &Path) {
match parts.next() {
Some("read_bytes") => {
... | 1 | 2 | 2 |
6e5d7f6aea62f1d1095a58fa5f8f0aba274984dd | Guillaume Gomez | 2020-04-15T13:12:02 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 023cd90..4f25d3a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.2"
+version = "0.13.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
a096129a38cf1032edc5fb4498861668d3cfe3ee | Guillaume Gomez | 2020-04-15T13:11:36 | Disk fix | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index a3b53fa..86b4010 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -16,90 +16,14 @@ use std::mem;
use std::os::unix::ffi::OsStrExt;
use std::path::{Path, PathBuf};
-fn find_type_for_name(name: &OsStr) -> DiskType {
- /*
- The format of devic... | 2 | 155 | 127 |
f7d599d44b9e0fb1208ec1707f6703cb7c2fb90c | Bastian Köcher | 2020-04-15T11:59:12 | Fix out of bound slice access
We can not assume that the slice always has 5 elements. This rewrites
the code to use `starts_with`. | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 0b23a8c..fd303b4 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -98,11 +98,11 @@ macro_rules! to_str {
fn boot_time() -> u64 {
if let Ok(f) = File::open("/proc/stat") {
let buf = BufReader::new(f);
- let mut it = buf.split... | 1 | 5 | 5 |
4114729a90dad1db4046e16e6eb12c9ecc0eeac9 | Guillaume Gomez | 2020-04-13T15:27:02 | Add bench for refreshing one disk | diff --git a/benches/basic.rs b/benches/basic.rs
index ab106b1..81bf4e4 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -4,7 +4,7 @@ extern crate sysinfo;
extern crate test;
use sysinfo::get_current_pid;
-use sysinfo::SystemExt;
+use sysinfo::{DiskExt, SystemExt};
#[bench]
fn bench_new(b: &mut test::Ben... | 1 | 12 | 1 |
2e05416dba2f01a2efc9e034b1257e1e193366e3 | Guillaume Gomez | 2020-04-13T13:32:24 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 990de4b..023cd90 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.1"
+version = "0.13.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
0495067bfc97c17ca87dd92eb3ad47707d9e494a | Guillaume Gomez | 2020-04-13T13:32:13 | Clean up comments a bit | diff --git a/src/linux/system.rs b/src/linux/system.rs
index bc45129..0b23a8c 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -874,8 +874,8 @@ fn get_all_disks() -> Vec<Disk> {
.map(|line| {
let line = line.trim_start();
// mounts format
- //http://man7.org/li... | 1 | 6 | 6 |
2f3754722b813063aa5afaf42d8ba1ed6be70aa5 | Benjamin Vaisvil | 2020-04-12T22:00:07 | cargo fmt | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 78e8a0f..bc45129 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -902,12 +902,12 @@ fn get_all_disks() -> Vec<Disk> {
fs_file.starts_with("/proc") ||
fs_file.starts_with("/run") ||
fs_file.starts_w... | 1 | 6 | 6 |
4973cdda1f7f7822d06ef3a98c6d43c15921cde7 | Benjamin Vaisvil | 2020-04-12T21:23:13 | refactored into a single check, added rpc_pipefs | diff --git a/src/linux/system.rs b/src/linux/system.rs
index c8234e4..78e8a0f 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -885,28 +885,29 @@ fn get_all_disks() -> Vec<Disk> {
.filter(|(fs_spec, fs_file, fs_vfstype)| {
// Check if fs_vfstype is one of our 'ignored' file systems
... | 1 | 18 | 17 |
5435ae617e53a9eb4b1f58779992086a309864bc | benjamin | 2020-04-12T19:43:15 | cargo fmt | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 71d854f..c8234e4 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -869,53 +869,49 @@ pub fn get_all_data<P: AsRef<Path>>(file_path: P, size: usize) -> io::Result<Str
fn get_all_disks() -> Vec<Disk> {
let content = get_all_data("/proc/mounts... | 1 | 39 | 43 |
b06d17226f41194a1cdb5aab5b1d1762705c1eab | benjamin | 2020-04-12T19:37:10 | A little cleaner, split the line only once | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 5a86882..71d854f 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -869,14 +869,22 @@ pub fn get_all_data<P: AsRef<Path>>(file_path: P, size: usize) -> io::Result<Str
fn get_all_disks() -> Vec<Disk> {
let content = get_all_data("/proc/mounts... | 1 | 31 | 29 |
950c91debfab5245977061c4f835efad231d9f7e | benjamin | 2020-04-12T18:01:16 | Change file system / disk filters on /proc/mounts to fix issue 295. | diff --git a/src/linux/system.rs b/src/linux/system.rs
index bc348d5..5a86882 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -855,17 +855,10 @@ fn copy_from_file(entry: &Path) -> Vec<String> {
fn get_all_data_from_file(file: &mut File, size: usize) -> io::Result<String> {
use std::io::Seek;
-
- ... | 1 | 33 | 24 |
cda6470c1c32bd7cbbfb55fa9621a5cacb2aa55b | Allen Bai | 2020-04-12T03:05:56 | linux/disk.rs: fix unknown disk type error
Fixes the mis-aslignment between the name inside /proc/mounts
and /sys/block devices. For example, the device /dev/mapper/
fedora_localhost--live-root is a symbolic link to /dev/dm-0 and
there's no device fedora_localhost--live-root under /sys/block.
Instead find the target o... | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index 5d87755..a3b53fa 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -11,20 +11,56 @@ use DiskType;
use libc::statvfs;
use std::ffi::{OsStr, OsString};
+use std::fs;
use std::mem;
use std::os::unix::ffi::OsStrExt;
use std::path::{Path, PathBuf};
f... | 2 | 45 | 9 |
455a5f99c8790c7d60e86ea30f69c1dfed68a218 | Chris Atkin | 2020-04-11T20:37:43 | Move comment as per authors request | diff --git a/src/linux/component.rs b/src/linux/component.rs
index 0ef475f..4985b17 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -14,10 +14,11 @@ use std::path::{Path, PathBuf};
/// More information can be found at [kernel.org][k].
///
+/// Note: these may not be present on virtual Linux syst... | 1 | 4 | 3 |
ec098b512813f53110ab2da7464bb5585eaa929e | Chris Atkin | 2020-04-11T20:18:37 | Add comment about virtual systems | diff --git a/src/linux/component.rs b/src/linux/component.rs
index d203d59..0ef475f 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -15,6 +15,9 @@ use std::path::{Path, PathBuf};
/// More information can be found at [kernel.org][k].
///
/// [k]: https://www.kernel.org/doc/Documentation/hwmon/sysf... | 1 | 3 | 0 |
4c491ac2a9cc222c311c284de94bc229fe8f5eb2 | Guillaume Gomez | 2020-04-09T13:33:12 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 3be8e3a..990de4b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.13.0"
+version = "0.13.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
1265936f06e9b752e1d157dc4f9f59e29d8d0f78 | Guillaume Gomez | 2020-04-09T13:32:59 | Improve documentation | diff --git a/src/common.rs b/src/common.rs
index da53b4e..3fbcf19 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -413,12 +413,12 @@ impl UserExt for User {
/// let s = System::new_all();
/// for (pid, process) in s.get_processes() {
/// let disk_usage = process.disk_usage();
-/// println!("[{}] read bytes... | 1 | 4 | 4 |
cea4b7a464e6fb8f17fcb1ff089a9b93ec87d63d | GuillaumeGomez | 2020-04-08T20:14:09 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 0f171f2..3be8e3a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.12.0"
+version = "0.13.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
ab9d63df0ce1f7c1a753b52d743fe58951ef9610 | Guillaume Gomez | 2020-04-08T14:42:13 | Replace prints with sysinfo_debug macro | diff --git a/src/mac/disk.rs b/src/mac/disk.rs
index 6714204..d1c8261 100644
--- a/src/mac/disk.rs
+++ b/src/mac/disk.rs
@@ -86,7 +86,7 @@ fn get_disk_types() -> HashMap<OsString, DiskType> {
&mut media_iterator,
);
if result != ffi::KERN_SUCCESS as i32 {
- //println!("Error: I... | 5 | 12 | 22 |
bf16c486695bdd111f796cff053e858353e7f18d | Guillaume Gomez | 2020-04-06T12:48:01 | Check if a winrt functionality is available before using it | diff --git a/Cargo.toml b/Cargo.toml
index 892f8e7..3159c90 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ doc-comment = "0.3"
once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "syncha... | 3 | 94 | 42 |
202000ecccc4d40f82aff50ffe37661e9aaa6833 | Guillaume Gomez | 2020-04-05T22:01:55 | Fix doc links | diff --git a/src/common.rs b/src/common.rs
index 1d0fe77..3655cb2 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -349,7 +349,7 @@ pub enum Signal {
/// A struct representing system load average value.
///
-/// It is returned by [`SystemExt::get_load_average`].
+/// It is returned by [`SystemExt::get_load_average... | 1 | 3 | 3 |
864377c1e629495230a331245c54ce282e4401b7 | Guillaume Gomez | 2020-04-05T22:00:31 | Update unknown targets API | diff --git a/src/unknown/process.rs b/src/unknown/process.rs
index d79bafd..b55884f 100644
--- a/src/unknown/process.rs
+++ b/src/unknown/process.rs
@@ -5,6 +5,7 @@
//
use std::path::Path;
+use DiskUsage;
use Pid;
use ProcessExt;
@@ -79,4 +80,8 @@ impl ProcessExt for Process {
fn cpu_usage(&self) -> f32 {
... | 1 | 5 | 0 |
60feb1c4718d20dedcd312b080223044d55aa165 | Guillaume Gomez | 2020-04-05T21:43:20 | Update tests | diff --git a/src/common.rs b/src/common.rs
index 72cc3a6..1d0fe77 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -416,6 +416,7 @@ impl UserExt for User {
/// disk_usage.total_read_bytes,
/// );
/// println!("[{}] written bytes: new/total => {}/{}",
+/// pid,
/// disk_usage.written... | 2 | 4 | 4 |
9ad5fe662aa27fce1b2e0ebaad55f1d26995b5bc | Guillaume Gomez | 2020-04-05T21:39:00 | Update linux API | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 4840cc0..f2fbe69 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -11,6 +11,7 @@ use std::path::{Path, PathBuf};
use libc::{c_int, gid_t, kill, uid_t};
+use DiskUsage;
use Pid;
use ProcessExt;
@@ -124,8 +125,10 @@ pub struct Process ... | 3 | 48 | 30 |
de90886afa7589add1c0d6ec70b950ede768b4f9 | GuillaumeGomez | 2020-04-05T15:52:41 | Update windows to new DiskUsage | diff --git a/src/windows/process.rs b/src/windows/process.rs
index ca571df..0643d40 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -4,6 +4,7 @@
// Copyright (c) 2018 Guillaume Gomez
//
+use std::cell::RefCell;
use std::fmt::{self, Debug};
use std::mem::{size_of, zeroed, MaybeUninit};
use std... | 1 | 70 | 17 |
db7931017841647c3a568d5e330dedaeec178e24 | Guillaume Gomez | 2020-04-05T15:22:01 | Fix bench typo | diff --git a/benches/basic.rs b/benches/basic.rs
index 0666a05..b146493 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -71,7 +71,7 @@ fn bench_refresh_disks(b: &mut test::Bencher) {
}
#[bench]
-fn bench_refresh_disks_lists(b: &mut test::Bencher) {
+fn bench_refresh_disks_list(b: &mut test::Bencher) {
... | 1 | 1 | 1 |
7a1b80ee02063089ed66e2d4562bbf9fe27f0abb | Guillaume Gomez | 2020-04-05T15:21:15 | Clean up mac disk usage code | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index 97fd3d5..8fc30d1 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -30,6 +30,7 @@ extern "C" {
//pub fn proc_regionfilename(pid: c_int, address: u64, buffer: *mut c_void,
// buffersize: u32) -> c_int;
pub fn proc_pidpath(pid: ... | 4 | 39 | 32 |
bd40c05366ed717bc3675c232df63651980fb4f5 | Guillaume Gomez | 2020-04-05T15:21:00 | Update ProcessExt::get_disk_usage | diff --git a/src/common.rs b/src/common.rs
index 80832e8..72cc3a6 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -410,17 +410,25 @@ impl UserExt for User {
/// let s = System::new_all();
/// for (pid, process) in s.get_processes() {
/// let disk_usage = process.get_disk_usage();
-/// println!("[{}] read/w... | 2 | 14 | 2 |
b852d547bd4a601534caafebfcbf2ca0222b1113 | GuillaumeGomez | 2020-04-05T11:58:37 | Only compute disk usage when required | diff --git a/src/common.rs b/src/common.rs
index e9696ce..80832e8 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -386,8 +386,8 @@ pub struct LoadAvg {
/// ```
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
pub struct User {
- name: String,
- groups: Vec<String>,
+ pub(crate) name: String,
+ pub(crat... | 5 | 74 | 74 |
8005a36810beaf5427907008e12472354290da07 | GuillaumeGomez | 2020-04-05T11:35:37 | Move common types to common file | diff --git a/src/common.rs b/src/common.rs
index 632deba..e9696ce 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -7,6 +7,7 @@
use NetworkData;
use Networks;
use NetworksExt;
+use UserExt;
/// Trait to have a common fallback for the [`Pid`][crate::Pid] type.
pub trait AsU32 {
@@ -273,3 +274,128 @@ impl From<is... | 2 | 127 | 126 |
b1f8e4f136f4b39a7c2d8bc3b0f629d60a6ac4bb | GuillaumeGomez | 2020-04-05T10:47:42 | Improve Windows situation for disk usage | diff --git a/src/windows/process.rs b/src/windows/process.rs
index f6a5aa7..2f3aa85 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -28,12 +28,9 @@ use winapi::um::psapi::{
LIST_MODULES_ALL, PROCESS_MEMORY_COUNTERS, PROCESS_MEMORY_COUNTERS_EX,
};
use winapi::um::sysinfoapi::GetSystemTimeAsFil... | 2 | 73 | 30 |
de696d9e450d21b9f3078aa1cd345405502d848e | Benjamin Vaisvil | 2020-01-31T04:26:59 | cleaned up get_disk_usage | diff --git a/src/windows/process.rs b/src/windows/process.rs
index b919370..f6a5aa7 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -606,40 +606,39 @@ pub(crate) fn get_system_computation_time() -> ULARGE_INTEGER {
}
}
-pub(crate) fn get_disk_usage(p: &mut Process) {
- let diag_info = Pro... | 1 | 30 | 31 |
a5f28215aef3a78b37a9a0a941abbbdc430a3cad | Benjamin Vaisvil | 2020-01-30T05:34:29 | cargo fmt | diff --git a/src/linux/process.rs b/src/linux/process.rs
index cfbae6a..4840cc0 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -125,7 +125,7 @@ pub struct Process {
pub tasks: HashMap<Pid, Process>,
pub(crate) stat_file: Option<File>,
pub(crate) read_bytes: u64,
- pub(crate) written_b... | 7 | 63 | 59 |
09a36fe2de6f54be6a4de43aeb47a2b3c8808171 | Benjamin Vaisvil | 2020-01-30T05:30:04 | refactored to remove usage of unwrap | diff --git a/src/windows/process.rs b/src/windows/process.rs
index d98a2bf..412cdb8 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -607,35 +607,37 @@ pub(crate) fn get_system_computation_time() -> ULARGE_INTEGER {
}
pub(crate) fn get_disk_usage(p: &mut Process){
- let r = ProcessDiagnosticIn... | 1 | 31 | 29 |
49eacdae433c184d419866f44c03a90aa8d29e2e | Benjamin Vaisvil | 2020-01-29T04:04:57 | Changed test to check only current pid | diff --git a/tests/process.rs b/tests/process.rs
index f7e325c..47629c9 100644
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -63,7 +63,7 @@ fn test_get_cmd_line() {
#[test]
fn test_process_disk_usage() {
- use sysinfo::{ProcessExt, SystemExt};
+ use sysinfo::{ProcessExt, SystemExt, get_current_pid};
u... | 1 | 4 | 9 |
f9045133c0e85cd63c44faa51310ae6946421d37 | Benjamin Vaisvil | 2020-01-28T15:26:13 | added read_bytes/written_bytes to complete trait for windows | diff --git a/src/windows/process.rs b/src/windows/process.rs
index ef8c219..d98a2bf 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -387,6 +387,14 @@ impl ProcessExt for Process {
fn cpu_usage(&self) -> f32 {
self.cpu_usage
}
+
+ fn read_bytes(&self) -> u64{
+ self.read_... | 1 | 8 | 0 |
5b684bf8faa9672fecb0af078a1b3c1cfe1da7c0 | benjamin | 2020-01-28T03:58:29 | missed one | diff --git a/src/linux/system.rs b/src/linux/system.rs
index c515be8..7d4892c 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -838,7 +838,7 @@ fn update_process_disk_activity(p: &mut Process){
p.read_bytes = d[1].parse::<u64>().unwrap_or(0);
}
else if d[0] == "write_bytes"{
... | 1 | 1 | 1 |
c8bded8b0a3d4b9d13e4628aa32790af66087b25 | Benjamin Vaisvil | 2020-01-28T03:54:28 | refactored to more closely match crate style | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 11dd8c4..cfbae6a 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -124,8 +124,8 @@ pub struct Process {
/// Tasks run by this process.
pub tasks: HashMap<Pid, Process>,
pub(crate) stat_file: Option<File>,
- pub read_bytes: u... | 5 | 38 | 16 |
2619090e9c2a498d45776892579e2845c94e114e | Benjamin Vaisvil | 2020-01-27T01:30:59 | added windows support | diff --git a/Cargo.toml b/Cargo.toml
index 0f171f2..892f8e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,6 +21,7 @@ once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "win... | 5 | 74 | 2 |
e9ea2617b270dbdb1b4d684b855d673729a52631 | Benjamin Vaisvil | 2020-01-26T04:11:37 | fixed mac compilation issues | diff --git a/src/mac/process.rs b/src/mac/process.rs
index c32a2f5..ad560c1 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -151,7 +151,6 @@ pub struct Process {
pub status: Option<ThreadStatus>,
pub read_bytes: u64,
pub write_bytes: u64
- }
}
impl Process {
@@ -215,6 +214,8 @@ impl Proce... | 1 | 6 | 3 |
08d2c93b10d775370e24bfbdade3be74cc88d010 | Benjamin Vaisvil | 2020-01-26T04:01:47 | update disk usage for mac processes | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index f3e0223..236788b 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -130,6 +130,11 @@ extern "C" {
// pub fn proc_name(pid: i32, buf: *mut i8, bufsize: u32) -> i32;
}
+#[link(name = "proc", kind = "dylib")]
+extern {
+ pub fn proc_pid_rusage(pid: c_int, flavor:... | 2 | 54 | 1 |
2ecf9dfab535032fa6d30a0b7f3be9beabb6b3c5 | Benjamin Vaisvil | 2020-01-26T03:53:38 | support for process disk r/w bytes for linux | diff --git a/src/linux/process.rs b/src/linux/process.rs
index f0eb027..11dd8c4 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -124,6 +124,8 @@ pub struct Process {
/// Tasks run by this process.
pub tasks: HashMap<Pid, Process>,
pub(crate) stat_file: Option<File>,
+ pub read_bytes: u... | 2 | 23 | 0 |
8be940f643453e940dadd5138e6b3a6af5cb5c6a | Alexander Larin | 2020-03-21T09:39:19 | Remove windows note on cmd() method | diff --git a/src/traits.rs b/src/traits.rs
index b0687ae..88a3122 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -147,8 +147,6 @@ pub trait ProcessExt: Debug {
fn name(&self) -> &str;
/// Returns the command line.
- // ///
- // /// On Windows, this is always a one element vector.
///
/// ... | 1 | 0 | 2 |
74f824aee0dc88e927637eab47e9ea19a7421429 | Guillaume Gomez | 2020-03-19T13:32:09 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index b1b9f58..0f171f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.11.7"
+version = "0.12.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
d7304e3fa130ad9166927f8762a7d063ccb63675 | Guillaume Gomez | 2020-03-19T14:16:50 | Remove old Error::description usage | diff --git a/src/linux/system.rs b/src/linux/system.rs
index daec3c6..7c23dc2 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -19,7 +19,6 @@ use {ProcessExt, RefreshKind, SystemExt};
use libc::{self, gid_t, sysconf, uid_t, _SC_CLK_TCK, _SC_PAGESIZE};
use std::cell::UnsafeCell;
use std::collections::Has... | 1 | 1 | 2 |
bca480f1ded0ccc2db1bb5e141a07f6113abf79f | Guillaume Gomez | 2020-03-19T10:57:25 | Ensure Send and Sync traits are implementated on System | diff --git a/src/sysinfo.rs b/src/sysinfo.rs
index ef6913a..12fae02 100644
--- a/src/sysinfo.rs
+++ b/src/sysinfo.rs
@@ -316,3 +316,18 @@ mod test {
assert!(s.get_users().len() >= MIN_USERS);
}
}
+
+// Used to check that System is Send and Sync.
+#[cfg(doctest)]
+doc_comment!(
+ "
+```
+fn is_send<T: ... | 5 | 36 | 3 |
d0377fd6da4f4bc7d0a5eef1751aa66d431753fd | Guillaume Gomez | 2020-03-18T15:25:47 | Remove unused variable | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index cc79b86..8bd69b5 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -321,7 +321,6 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
}
}
"boot_time" => {
- let mut uptime = sys.get_b... | 1 | 0 | 1 |
d95206e27c9843ce3a05c437e4b033d8f84ba1a3 | Guillaume Gomez | 2020-03-18T15:16:24 | Improve documentation | diff --git a/src/common.rs b/src/common.rs
index 5cb51f6..632deba 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -43,8 +43,6 @@ macro_rules! impl_get_set {
doc_comment! {
concat!("Returns the value of the \"", stringify!($name), "\" refresh kind.
-# Examples
-
```
use sysinfo::RefreshKind;
@@... | 5 | 59 | 50 |
aa3d3672b9e250366972563352cf647ce276c13a | Guillaume Gomez | 2020-03-17T14:59:06 | Update cmd tests to prevent failure in case of no network | diff --git a/tests/process.rs b/tests/process.rs
index 7048e47..fcabbe6 100644
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -37,29 +37,26 @@ fn test_process_refresh() {
#[test]
#[cfg(windows)]
fn test_get_cmd_line() {
- let p = std::process::Command::new("ping")
- .arg("localhost")
- .arg("-n")
... | 1 | 6 | 9 |
6c6e9eb1d4e990887ba679596d4a04a8f8381b98 | Guillaume Gomez | 2020-03-11T16:51:57 | Upgrade crate version | diff --git a/Cargo.toml b/Cargo.toml
index db626aa..b1b9f58 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.11.6"
+version = "0.11.7"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
1bbf7b2964c6630271ba37e44679f55d6d2693f7 | GuillaumeGomez | 2020-03-07T22:16:41 | Clean up doc for refresh_components | diff --git a/src/windows/system.rs b/src/windows/system.rs
index 7833d0a..a3d03c2 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -14,7 +14,6 @@ use std::collections::HashMap;
use std::mem::{size_of, zeroed};
use std::time::SystemTime;
-use ComponentExt;
use LoadAvg;
use Networks;
use Pid;
@@ -... | 1 | 0 | 18 |
d1e8e89190c00a2d7a3e79456b1a2ec92f4b0839 | Guillaume Gomez | 2020-03-07T20:00:56 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 7446dec..58f6b66 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.11.5"
+version = "0.11.6"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
b7477ed3dde07b592d5d4e48db401ae8472df6f5 | Alexander Larin | 2020-03-07T17:57:21 | Fix typo | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 9a32333..cffac2d 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -469,7 +469,7 @@ fn get_cmd_line(handle: HANDLE) -> Vec<String> {
}
buffer_copy.push(0);
- // Get argc and argv from coomand line
+ //... | 1 | 1 | 1 |
8fb27ef849d80c6f13b2d1c96681ffec045255b0 | Alexander Larin | 2020-03-07T09:27:56 | Remove unused function | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 2b83e10..909372a 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -402,10 +402,6 @@ unsafe fn get_start_time(handle: HANDLE) -> u64 {
tmp / 10_000_000 - 11_644_473_600
}
-fn parse_cmd_line(cmdline: &str) -> Vec<String> {
- ... | 1 | 0 | 4 |
ee9b156d306abadc804b0560cbb9b9a4508b0032 | Alexander Larin | 2020-03-07T09:27:16 | Use process handle instead pid in get_cmd_line | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 5303a9e..2b83e10 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -204,7 +204,7 @@ impl Process {
name,
pid,
parent,
- cmd: get_cmd_line(pid),
+ cmd: get... | 1 | 9 | 22 |
7156492b0a13effb3e8a4ed2eee00aae7eab4331 | Alexander Larin | 2020-03-07T09:17:52 | Parse cmdline by CommandLineToArgvW. Tests passed | diff --git a/Cargo.toml b/Cargo.toml
index 9fd624f..14a936a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ doc-comment = "0.3"
once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "syncha... | 2 | 25 | 8 |
e2b03b8b1c36e7f73ca83ffedc8ff07ba3444dbf | Guillaume Gomez | 2020-03-06T13:48:02 | Remove unneeded macro in mac disk file | diff --git a/src/mac/disk.rs b/src/mac/disk.rs
index 0514621..6714204 100644
--- a/src/mac/disk.rs
+++ b/src/mac/disk.rs
@@ -68,15 +68,6 @@ impl DiskExt for Disk {
}
}
-macro_rules! unwrapper {
- ($b:expr, $ret:expr) => {{
- match $b {
- Ok(x) => x,
- _ => return $ret,
- }... | 1 | 20 | 26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.