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
6307c35aa12644c107e0658920fd67eedd743045
Guillaume Gomez
2024-12-03T23:16:42
Rename `Components::refresh_list` into `refresh`
diff --git a/benches/basic.rs b/benches/basic.rs index 5148d29..e764622 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -118,17 +118,7 @@ fn bench_refresh_components(b: &mut test::Bencher) { let mut c = sysinfo::Components::new_with_refreshed_list(); b.iter(move || { - c.refresh(); - }); -...
12
202
157
d5d574091cc9e1c2f876a5e2edf7754b11f93ba9
Guillaume Gomez
2024-12-01T23:43:09
Add missing documentation for returned value of `Process::kill` and add extra explanations
diff --git a/src/common/system.rs b/src/common/system.rs index 450357f..61bce36 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1093,6 +1093,14 @@ impl Process { /// Sends [`Signal::Kill`] to the process (which is the only signal supported on all supported /// platforms by this crate). /...
1
13
2
17771c74e6db1c48c3b38822c3097cbc29174655
Guillaume Gomez
2024-11-28T23:20:19
Rename `*RefreshKind::new` method into `nothing`
diff --git a/src/common/disk.rs b/src/common/disk.rs index cf570e3..04986f8 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -157,7 +157,7 @@ impl Disk { /// /// let mut disks = Disks::new_with_refreshed_list(); /// for disk in disks.list_mut() { - /// disk.refresh_specifics(DiskRefresh...
10
69
69
08e3d1361d1b10d08379831c97f17fd2928aff98
Guillaume Gomez
2024-11-29T22:29:28
Improve disk list refresh and rename `DiskRefreshKind::details` into `DiskRefreshKind::storage`
diff --git a/benches/basic.rs b/benches/basic.rs index 2853b1b..6b050fc 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -86,7 +86,7 @@ fn bench_refresh_disks_list(b: &mut test::Bencher) { let mut disks = sysinfo::Disks::new_with_refreshed_list(); b.iter(move || { - disks.refresh_list(); + ...
11
465
433
2de279e2be9aa984c2fefdc5d4d6b189e9f95047
mert-kurttutan
2024-11-29T08:34:34
Update Arm Part list
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index 5e8d55d..c97e84e 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -530,7 +530,7 @@ fn get_arm_implementer(implementer: u32) -> Option<&'static str> { /// Obtain the part of this CPU core. /// /// This has been obtained from util-linux'...
1
13
1
4c8a1eadefa557be798d37b50633dc9ad938607f
Guillaume Gomez
2024-11-28T01:55:10
Code cleanup
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index e2f5e28..712f9f0 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -74,19 +74,23 @@ impl DiskInner { pub(crate) fn refresh_specifics(&mut self, refresh_kind: DiskRefreshKind) -> bool { if refresh_kind.kind() && self.typ...
5
94
77
2484edccb7d54284a751077e39abe4b210aa6327
David Tolnay
2024-11-26T17:43:36
Manual formatting fixes
diff --git a/src/unix/freebsd/network.rs b/src/unix/freebsd/network.rs index fa5ae5a..b28ea9a 100644 --- a/src/unix/freebsd/network.rs +++ b/src/unix/freebsd/network.rs @@ -93,7 +93,7 @@ impl NetworksInner { old_and_new!(interface, ifi_ierrors, old_ifi_ierrors, data); o...
3
4
4
ab3088139a7a48d0b40a8204e2519f38c167811b
David Tolnay
2024-11-26T17:43:01
Format with rustfmt 1.8.0-nightly
diff --git a/src/unix/apple/macos/component/arm.rs b/src/unix/apple/macos/component/arm.rs index b06ffaf..6923e98 100644 --- a/src/unix/apple/macos/component/arm.rs +++ b/src/unix/apple/macos/component/arm.rs @@ -111,7 +111,8 @@ impl ComponentsInner { None => continue, }; - ...
21
418
282
ab99a3955b4554c6d58f46dd19d502e2823bfd73
David Tolnay
2024-11-26T17:34:21
Make all source files visible to rustfmt
diff --git a/src/lib.rs b/src/lib.rs index 9c12c2e..1a1e411 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,6 +116,16 @@ mod debug; mod serde; pub(crate) mod utils; +// Make formattable by rustfmt. +#[cfg(any())] +mod network; +#[cfg(any())] +mod unix; +#[cfg(any())] +mod unknown; +#[cfg(any())] +mod windows; + /...
8
130
0
fb3b1a6cf5914aa6c52d529b7bbda223381ec53b
Guillaume Gomez
2024-11-26T10:22:58
Update crate version to 0.32.1
diff --git a/Cargo.toml b/Cargo.toml index c66813e..a60eb44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.32.0" +version = "0.32.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
b82082fbec4f17966220850d7b5dd6bfda7484e7
Radu Bloch
2024-11-26T10:17:24
Fix Windows CPU frequency not refreshing
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs index 5ad36ea..e84f1b4 100644 --- a/src/windows/cpu.rs +++ b/src/windows/cpu.rs @@ -250,7 +250,6 @@ impl Query { pub(crate) struct CpusWrapper { pub(crate) global: CpuUsage, cpus: Vec<Cpu>, - got_cpu_frequency: bool, } impl CpusWrapper { @@ -261,7 +...
1
0
7
4ed3acbd77244a8edbb4d489575ca10072df5637
David Tolnay
2024-11-26T03:10:43
Ignore libc mach_host_self and mach_task_self deprecations for now
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 7fd63ef..c366cba 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -3,7 +3,9 @@ use crate::sys::utils::{get_sys_value, get_sys_value_by_name}; use crate::{Cpu, CpuRefreshKind}; -use libc::{c_char, c_void, host_processor_info, mach_port...
4
13
2
0862b6c4998afd2d31b700eb89421b02f0f213bb
David Tolnay
2024-11-26T03:03:57
Deal with libc 0.2.165's removal of array size hacks
diff --git a/Cargo.toml b/Cargo.toml index 652a6b6..c66813e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ ntapi = { version = "0.4", optional = true } windows = { version = ">=0.54, <=0.57", optional = true } [target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies] -libc =...
2
2
2
dd78adb0a68d18c4fca1254d188ac29d7d35b9ff
Guillaume Gomez
2024-11-25T17:04:11
Improve components retrieval on Windows
diff --git a/src/windows/component.rs b/src/windows/component.rs index 8195b0b..b11a195 100644 --- a/src/windows/component.rs +++ b/src/windows/component.rs @@ -6,7 +6,7 @@ use windows::core::{w, VARIANT}; use windows::Win32::Foundation::{SysAllocString, SysFreeString}; use windows::Win32::Security::PSECURITY_DESCRIP...
1
42
26
48d04ec3ce5f8f410ca3fc7f093536019847ac93
Guillaume Gomez
2024-11-24T23:37:34
Use libgeom to get disk I/O information on FreeBSD
diff --git a/src/common/disk.rs b/src/common/disk.rs index 0c2712b..1fe004f 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -149,8 +149,6 @@ impl Disk { /// Returns number of bytes read and written by the disk /// - /// ⚠️ Note that FreeBSD is not yet supported - /// /// ```no_run ...
3
210
111
3079bc5a6080201c5207a1de00db4a1e9d8ee825
Guillaume Gomez
2024-11-11T23:07:33
Add disk I/O support on freebsd
diff --git a/Cargo.toml b/Cargo.toml index 14c0a74..652a6b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,3 +120,4 @@ tempfile = "3.9" name = "simple" path = "examples/simple.rs" required-features = ["default"] +doc-scrape-examples = true diff --git a/src/unix/freebsd/disk.rs b/src/unix/freebsd/disk.rs index b419...
6
334
48
0fcea613abf41c58649d8589ee97efc5b74f3644
Dario Saccavino
2024-11-12T22:49:24
Windows: allow recovering from performance counter errors When the CPU performance counters cannot be opened because the performance counter registry is in an invalid state, recreate the query at the next CPU information refresh, adding a request to the performance library to reload the performance counter registry.
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs index 1830bd2..5ad36ea 100644 --- a/src/windows/cpu.rs +++ b/src/windows/cpu.rs @@ -9,14 +9,14 @@ use std::mem; use std::ops::DerefMut; use std::sync::{Mutex, OnceLock}; -use windows::core::{s, PCSTR, PCWSTR}; +use windows::core::{s, PCSTR, PCWSTR, PSTR}; use wi...
2
30
20
f40f073248abd1b49bf4a93bc107f9b7ab2ac959
Guillaume Gomez
2024-11-11T14:20:26
Remove procfs dependency and fix local disk I/O test
diff --git a/Cargo.toml b/Cargo.toml index a70092d..14c0a74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,9 +111,6 @@ core-foundation-sys = "0.8.7" [target.'cfg(all(target_os = "linux", not(target_os = "android")))'.dev-dependencies] tempfile = "3.9" -[target.'cfg(any(target_os = "linux", target_os = "android"))...
3
162
76
5ae947499977d7b26ed56695bb9f7729be95d9f1
Guillaume Gomez
2024-11-10T22:01:48
Fix network data information being limited to 32 bits on mac
diff --git a/src/unix/apple/network.rs b/src/unix/apple/network.rs index 6c9715f..642642a 100644 --- a/src/unix/apple/network.rs +++ b/src/unix/apple/network.rs @@ -1,18 +1,48 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use libc::{self, c_char, if_msghdr2, CTL_NET, NET_RT_IFLI...
1
99
51
2e78bd2cce5fbe809a26cca483b5b53fb8a985ba
Guillaume Gomez
2024-11-10T14:39:49
Update `core-foundation-sys` version
diff --git a/Cargo.toml b/Cargo.toml index 806bfe5..a70092d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,7 +106,7 @@ windows = { version = ">=0.54, <=0.57", optional = true } libc = "^0.2.153" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] -core-foundation-sys = "0.8" +core-foundation-...
3
6
15
7df7803a43312173b385e4d01362efd2ec00a42e
Shrey Amin
2024-11-04T01:51:38
Add test for disk I/O usage
diff --git a/Cargo.toml b/Cargo.toml index 94f18f6..806bfe5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,6 +117,7 @@ procfs = "0.17.0" [dev-dependencies] serde_json = "1.0" # Used in documentation tests. bstr = "1.9.0" +tempfile = "3.9" [[example]] name = "simple" diff --git a/tests/disk.rs b/tests/disk.rs n...
3
70
16
fd52c86b7c8efd4af4f5e1a8e52bc54a963e1766
Shrey Amin
2024-11-03T16:16:52
Address PR feedback
diff --git a/src/common/disk.rs b/src/common/disk.rs index 1fe004f..0c2712b 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -149,6 +149,8 @@ impl Disk { /// Returns number of bytes read and written by the disk /// + /// ⚠️ Note that FreeBSD is not yet supported + /// /// ```no_run ...
5
22
33
a4e7bd8472780a0908f159e53549d4e078e5f3be
Shrey Amin
2024-11-02T23:47:26
Fix CI build errors
diff --git a/src/common/mod.rs b/src/common/mod.rs index acc9601..d83dd9f 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -11,6 +11,46 @@ pub(crate) mod system; #[cfg(feature = "user")] pub(crate) mod user; +/// Type containing read and written bytes. +/// +/// It is returned by [`Process::disk_usage`][cr...
6
52
43
cc7c94574b97257a6b9b769e81c5285f93bbb1c9
Shrey Amin
2024-11-02T23:22:50
Fix doc string error
diff --git a/src/unix/linux/disk.rs b/src/unix/linux/disk.rs index cfa39cf..3919465 100644 --- a/src/unix/linux/disk.rs +++ b/src/unix/linux/disk.rs @@ -23,7 +23,7 @@ use std::path::{Path, PathBuf}; /// * <https://github.com/torvalds/linux/blob/4f671fe2f9523a1ea206f63fe60a7c7b3a56d5c7/include/linux/bio.h#L99> /// * <...
1
1
1
ab5a95ffa3e07f7c657ff5fdeb833cb21f3a9d7f
Shrey Amin
2024-11-02T21:42:43
Update for unsupported/unknown platforms
diff --git a/src/unix/freebsd/disk.rs b/src/unix/freebsd/disk.rs index ab39088..c19ce8f 100644 --- a/src/unix/freebsd/disk.rs +++ b/src/unix/freebsd/disk.rs @@ -58,6 +58,11 @@ impl DiskInner { refresh_disk(self, &mut vfs) } } + + pub(crate) fn usage(&self) -> DiskUsage { + // TODO: ...
2
19
0
40e7f830b64f3bb02a42d8f08b15b9b69b2507d3
Shrey Amin
2024-11-02T21:10:24
Add debug logs
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index 39fa98e..b80cbd7 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -73,14 +73,17 @@ impl DiskInner { } pub(crate) fn refresh(&mut self) -> bool { - self.old_read_bytes = self.read_bytes; - self.old_written_byt...
3
10
5
620c7172e8c8a4f35ff0d56ead4a0ec57eec3a52
Shrey Amin
2024-11-02T21:02:46
Add disk i/o stats on Windows
diff --git a/src/windows/disk.rs b/src/windows/disk.rs index 5c88067..50670ab 100644 --- a/src/windows/disk.rs +++ b/src/windows/disk.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::sys::utils::HandleWrapper; -use crate::{Disk, DiskKind}; +use crate::{Di...
1
84
3
4a0efa602003ae24d2bb8b39cb74a42ab76aa971
Shrey Amin
2024-11-01T16:47:21
Add disk i/o stats on macOS and Linux
diff --git a/Cargo.toml b/Cargo.toml index 249e90d..94f18f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,6 +111,9 @@ core-foundation-sys = "0.8" [target.'cfg(all(target_os = "linux", not(target_os = "android")))'.dev-dependencies] tempfile = "3.9" +[target.'cfg(any(target_os = "linux", target_os = "android"))'....
7
313
67
b39e42777dd5214172498968adafa53d4882938b
Guillaume Gomez
2024-11-01T00:07:29
Add documentation about `DiskUsage::read_bytes` not increasing
diff --git a/src/common/system.rs b/src/common/system.rs index 5fb8295..1409bec 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -942,6 +942,10 @@ pub struct CGroupLimits { /// /// It is returned by [`Process::disk_usage`][crate::Process::disk_usage]. /// +/// ⚠️ Files might be cached in memory by you...
1
8
0
f23e7fff77b4dfd92c827c6adda94567857dd80f
Samuel
2024-10-31T13:48:39
code comment
diff --git a/src/windows/system.rs b/src/windows/system.rs index d40fa74..40cf3a3 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -61,6 +61,10 @@ struct Wrap<T>(T); unsafe impl<T> Send for Wrap<T> {} unsafe impl<T> Sync for Wrap<T> {} +/// Calculates system boot time in seconds with improved preci...
1
4
0
ae609b1952ed7a70ed9c6c04f99c3f33b88d564b
Samuel
2024-10-31T13:03:06
fix(win): inconsistent boot_time
diff --git a/src/windows/system.rs b/src/windows/system.rs index a42ed49..d40fa74 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -63,7 +63,14 @@ unsafe impl<T> Sync for Wrap<T> {} unsafe fn boot_time() -> u64 { match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { - Ok(n) =>...
1
8
1
e7a9fec734f8acb9224563a22a6b7c0a11f0b7f7
Guillaume Gomez
2024-10-29T09:18:53
Add missing `mtu` field in `Debug` implementations and `serde`
diff --git a/src/debug.rs b/src/debug.rs index 43807a0..2cb15e5 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -130,6 +130,7 @@ impl std::fmt::Debug for crate::NetworkData { .field("total errors income", &self.total_errors_on_received()) .field("errors outcome", &self.errors_on_transmitted())...
2
4
2
93613198866788b42f53643ed87cd1718a61b751
Gwendal Didot
2024-10-28T14:58:40
feat(network): Add mtu information for interfaces
diff --git a/src/common/network.rs b/src/common/network.rs index 1505026..023993c 100644 --- a/src/common/network.rs +++ b/src/common/network.rs @@ -410,6 +410,20 @@ impl NetworkData { pub fn ip_networks(&self) -> &[IpNetwork] { self.inner.ip_networks() } + + /// Returns the Maximum Transfer Unit ...
6
62
0
2ab59dcb8979605029cfc920e9e8e18ea850c95b
Gwendal Didot
2024-10-28T10:07:58
fix(unix): add support for sub-interfaces in network_helpers::get_interface_ip_networks
diff --git a/src/unix/network_helper.rs b/src/unix/network_helper.rs index 8625eca..c41ab20 100644 --- a/src/unix/network_helper.rs +++ b/src/unix/network_helper.rs @@ -151,7 +151,18 @@ pub(crate) unsafe fn get_interface_ip_networks() -> HashMap<String, HashSet<IpNe let bytes = CStr::from_ptr(c_str).to_bytes()...
1
12
1
3b34892c1590cbb93146a5966cdb45052b9089b1
Guillaume Gomez
2024-10-26T13:57:41
Fix CPU computation on linux processes when not all of them are refreshed at once
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index dfee6b2..5e8d55d 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -19,11 +19,6 @@ macro_rules! to_str { pub(crate) struct CpusWrapper { pub(crate) global_cpu: CpuUsage, pub(crate) cpus: Vec<Cpu>, - /// Field set to `false` i...
2
2
18
a19bca44b2188e973b24e18b1e8d046792726e1d
Guillaume Gomez
2024-10-26T13:49:19
Cleanup code comments
diff --git a/src/windows/users.rs b/src/windows/users.rs index 3c767fa..bc25dc8 100644 --- a/src/windows/users.rs +++ b/src/windows/users.rs @@ -56,7 +56,6 @@ impl UserInner { pub(crate) fn groups(&self) -> Vec<Group> { if let (Some(c_user_name), true) = (&self.c_user_name, self.is_local) { - ...
2
2
9
f9d2deba6decc5d6eb63be799f8486f7b4b7fcf7
Sungmann Cho
2024-10-21T10:30:25
fix(macos): make `long_os_version()` capable of handling newer macOS versions This patch fixes an issue where the `long_os_version()` does not properly recognize some latest macOS versions—12 Monterey, 13 Ventura, and 15 Sequoia.
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index 44406f6..47c3a7e 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -392,14 +392,11 @@ impl SystemInner { pub(crate) fn long_os_version() -> Option<String> { #[cfg(target_os = "macos")] let friendly_name =...
1
5
8
c821de4249a85f566766890345830d4b24a2dcb7
Mr.gao
2024-10-10T19:37:20
fix(win): user.groupps() multiple times doesn't return the same output (#1359) fix: users.groupps() multiple times doesn't return the same output https://github.com/GuillaumeGomez/sysinfo/issues/1233 --------- Co-authored-by: unknown <gaoyan3@company.local>
diff --git a/src/windows/users.rs b/src/windows/users.rs index 0167339..3c767fa 100644 --- a/src/windows/users.rs +++ b/src/windows/users.rs @@ -16,6 +16,8 @@ use windows::Win32::Security::Authentication::Identity::{ SECURITY_LOGON_SESSION_DATA, SECURITY_LOGON_TYPE, }; +use super::utils::to_pcwstr; + pub(crate...
3
46
1
7e3f493f0c91382b94e77d179f48cd145e348fd0
TrentGL
2024-10-07T22:02:04
test: use assert!
diff --git a/src/common/system.rs b/src/common/system.rs index e572b9a..5fb8295 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -2462,7 +2462,7 @@ mod test { #[test] fn check_cpu_arch() { - assert_eq!(!System::cpu_arch().is_empty(), IS_SUPPORTED_SYSTEM); + assert!(!System::cpu_...
1
1
1
9ae2b39a276472ecd7afaec0a412c6b793c98ed3
TrentGL
2024-10-07T21:43:30
feat(common): fallback to std::env::consts::ARCH for System::cpu_arch
diff --git a/src/common/system.rs b/src/common/system.rs index 588b8c0..e572b9a 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -777,8 +777,8 @@ impl System { /// /// println!("CPU Architecture: {:?}", System::cpu_arch()); /// ``` - pub fn cpu_arch() -> Option<String> { - System...
1
3
3
9f14cba660204703cdbed2c26e9433a597bada1d
Guillaume Gomez
2024-10-05T21:39:19
Update crate version to 0.32.0
diff --git a/Cargo.toml b/Cargo.toml index 2ca8c6d..249e90d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.31.4" +version = "0.32.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
9c86e253dd0c3da7360e2d4a35631ba7945850a8
Guillaume Gomez
2024-10-05T21:45:29
Fix new clippy lints
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index 2d5014f..44406f6 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -89,9 +89,9 @@ pub(crate) struct SystemInner { pub(crate) struct Wrap<'a>(pub UnsafeCell<&'a mut HashMap<Pid, Process>>); #[cfg(all(target_os = "macos", not...
3
6
6
7452b8d8281bfac80cc855f68981898e65d1f1d1
Guillaume Gomez
2024-10-03T21:05:52
Update `System::refresh_processes` API to give control over when to remove dead processes
diff --git a/benches/basic.rs b/benches/basic.rs index 4d0f22f..2853b1b 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -33,9 +33,9 @@ fn bench_refresh_all(b: &mut test::Bencher) { fn bench_refresh_processes(b: &mut test::Bencher) { let mut s = sysinfo::System::new(); - s.refresh_processes(sysinfo::P...
17
299
162
6d5ea97adebfdd1a036e22fc0482261a41935690
Kevin Baker
2024-09-12T18:43:24
add dependency on windows SystemServices for disk
diff --git a/Cargo.toml b/Cargo.toml index 0f64683..2ca8c6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ disk = [ "windows/Win32_Security", # For `windows::Win32::Storage::FileSystem::CreateFileW`. "windows/Win32_System_IO", "windows/Win32_System_Ioctl", + "windows/Win32_System_SystemSer...
1
1
0
1c87f50f1cc24287bbde37f2310fa20ea9c43af6
Kevin Baker
2024-09-12T18:32:11
win: add correct location of FILE_READ_ONLY_VOLUME, correct call
diff --git a/src/windows/disk.rs b/src/windows/disk.rs index a201c3f..5c88067 100644 --- a/src/windows/disk.rs +++ b/src/windows/disk.rs @@ -12,8 +12,9 @@ use windows::core::{Error, HRESULT, PCWSTR}; use windows::Win32::Foundation::MAX_PATH; use windows::Win32::Storage::FileSystem::{ FindFirstVolumeW, FindNextVo...
1
2
2
38b85e66e9fb39397abf24ee576fdae6d1492af5
Kevin Baker
2024-09-12T18:21:19
cast to u32 for flag check
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index 23b42a3..7680b6c 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -427,7 +427,7 @@ unsafe fn new_disk( ) }; - let is_read_only = (c_disk.f_flags & libc::MNT_RDONLY) != 0; + let is_read_only = (c_disk.f_flags & li...
1
1
1
d0cc14182a5729ad58f369e0c4bff7b6d43805c4
Kevin Baker
2024-09-12T16:26:05
feat: Add is_read_only flag for disks across all platforms - Implement is_read_only flag for disks on macOS, FreeBSD, Linux, and Windows - Add is_read_only() method to the common Disk struct - Update documentation for the new is_read_only() method - Ensure consistent implementation across all supported platforms This...
diff --git a/src/common/disk.rs b/src/common/disk.rs index c23ee49..9057a5c 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -117,6 +117,20 @@ impl Disk { self.inner.is_removable() } + /// Returns `true` if the disk is read-only. + /// + /// ```no_run + /// use sysinfo::Disks; + ...
6
52
1
01df96d31ec9630e004a6fab458af291a246573d
Guillaume Gomez
2024-08-28T21:01:00
Update crate version to 0.31.4
diff --git a/Cargo.toml b/Cargo.toml index 1ce4df3..0f64683 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.31.3" +version = "0.31.4" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
5f78295b50c3e604d71f18fb45b5013b7b0d9f5f
ComplexSpaces
2024-08-28T17:44:22
Wrap Apple disk refreshing in autorelease pool to avoid system caching
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index 048c852..f16f528 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -92,7 +92,11 @@ impl crate::DisksInner { pub(crate) fn refresh_list(&mut self) { unsafe { - get_list(&mut self.disks); + // SAFETY...
2
44
1
e40096c7ada4055caae6f9e9e6c7b83978142ef3
Guillaume Gomez
2024-08-23T12:52:54
Update crate version to 0.31.3
diff --git a/Cargo.toml b/Cargo.toml index 68b3f1c..1ce4df3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.31.2" +version = "0.31.3" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
9acef9ff21ad958261165e12941135b5ac1982ed
rise0chen
2024-08-23T08:38:48
feat: support Raspberry Pi
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 417a48b..535080c 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -387,5 +387,16 @@ impl ComponentsInner { } } } + if self.components.is_empty() { + // Specf...
1
11
0
3bd911977a0fc439a1d02de34ae5766df1847c0c
Guillaume Gomez
2024-08-01T14:07:49
Update crate version to 0.31.2
diff --git a/Cargo.toml b/Cargo.toml index 0c11112..68b3f1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.31.1" +version = "0.31.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
73db406a181c03f1135aa7ae86266d539a73bcf2
Guillaume Gomez
2024-08-01T13:57:15
Remove usage of `trim_ascii` for now
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index e39c6dd..f3438a9 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -802,6 +802,26 @@ pub(crate) fn refresh_procs( nb_updated.into_inner() } +// FIXME: To be removed once MSRV for this crate is 1.80 nd use the `trim_...
1
21
1
6c1ef4a7a7a9bc371c0ce0ee06aac6412a7159ca
Guillaume Gomez
2024-08-01T13:48:36
Remove `bstr` dependency
diff --git a/Cargo.toml b/Cargo.toml index cc89cbb..0c11112 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,9 +101,6 @@ ntapi = { version = "0.4", optional = true } # versions when bumping to a new release, and only increase the minimum when absolutely necessary. windows = { version = ">=0.54, <=0.57", optional = tr...
3
3
8
84502ec0a429d2397f80eeab66d6c53145263f73
Guillaume Gomez
2024-08-01T13:10:30
Update crate version to 0.31.1
diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index af58cbf..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,400 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https:/...
2
1
401
4fe644b9a3b632a449cc1c21dabf3a73689a2d9f
Guillaume Gomez
2024-08-01T12:54:24
Remove Cargo.lock file
diff --git a/Cargo.lock b/Cargo.lock index 1fa1dfd..af58cbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bstr" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crate...
1
15
14
103566e41c1dcc9774881dbd4f118d0643fa2e4e
Guillaume Gomez
2024-08-01T12:54:08
Downgrade memchr to 2.5.0 to make it work in rustc
diff --git a/Cargo.toml b/Cargo.toml index c5fc044..e4233c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ cargo-args = ["-Zbuild-std"] rustdoc-args = ["--generate-link-to-definition"] [dependencies] -memchr = { version = "2.7.1", optional = true } +memchr = { version = "2.5", optional = true } rayon =...
1
1
1
b5c6d95323a058be0722fb51c4322efba62ca8b2
Guillaume Gomez
2024-07-31T12:17:49
Update crate version to 0.31.0
diff --git a/Cargo.lock b/Cargo.lock index 98dcc8c..1fa1dfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.13" +version = "0.31.0" dependencies = [ "bstr", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index b34de09..c5f...
2
2
2
d550d61d30697799615377a658f3149bf79465e3
Guillaume Gomez
2024-07-31T09:47:14
Group debug implementations by features
diff --git a/src/debug.rs b/src/debug.rs index 46a620f..43807a0 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -29,6 +29,29 @@ impl std::fmt::Debug for crate::System { } } +#[cfg(feature = "system")] +impl std::fmt::Debug for crate::Process { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Res...
1
23
23
ac26f6583628c5df3a82c07e4057f19959d3172e
Guillaume Gomez
2024-07-31T09:44:22
Group serde implementations by features
diff --git a/src/serde.rs b/src/serde.rs index f112ef0..50f8bde 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -175,34 +175,6 @@ impl Serialize for crate::CGroupLimits { } } -#[cfg(feature = "component")] -impl Serialize for crate::Components { - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Err...
1
76
76
bf9455c32bb890716153d58334dd6f555ed1cb72
Guillaume Gomez
2024-07-31T09:24:55
Adopt windows version range >=0.54, <=0.57 Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
diff --git a/Cargo.toml b/Cargo.toml index ff4c014..b34de09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,9 @@ serde = { version = "^1.0.190", optional = true } [target.'cfg(windows)'.dependencies] ntapi = { version = "0.4", optional = true } -windows = { version = "0.56", optional = true } +# Support a ran...
1
3
1
18649ae650d163d3077e7d830cb3cc841e738c3f
Guillaume Gomez
2024-07-24T20:45:38
Fix invalid CPU computation when multiple calls to `refresh_process` are done in succession on macOS
diff --git a/src/common/system.rs b/src/common/system.rs index 219d988..5fd0d05 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -367,6 +367,9 @@ impl System { /// exist (it will **NOT** be removed from the processes if it doesn't exist anymore). If it /// isn't listed yet, it'll be added. ...
3
85
16
acc6a4d8e95ea80bd0051a9c300fbe9f168365ea
Arnaud Rocher
2024-07-24T08:46:39
Fix typo in `Networks::new_with_refreshed_list()` documentation
diff --git a/src/common/network.rs b/src/common/network.rs index d46d4bf..1505026 100644 --- a/src/common/network.rs +++ b/src/common/network.rs @@ -55,8 +55,8 @@ impl Networks { } } - /// Creates a new [`Networks`][crate::Networks] type with the disk list - /// loaded. It is a combination of [`Ne...
1
2
2
cd63a2a953d73199715043d0fe29cfa58c4b62be
Guillaume Gomez
2024-07-23T22:09:23
Add test to ensure that refreshing one process does not remove any even if dead
diff --git a/tests/process.rs b/tests/process.rs index b03f837..f6f841a 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -3,28 +3,34 @@ #![cfg(feature = "system")] use bstr::ByteSlice; -use sysinfo::{Pid, ProcessRefreshKind, System, UpdateKind}; +use sysinfo::{Pid, ProcessRefreshKind, RefreshKind, System, Up...
1
66
106
e108b6c5d0d3433504e926c35858583204010ed4
Guillaume Gomez
2024-07-22T21:20:27
Fix virtual memory computation on Windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index 95eba11..79ff911 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -19,11 +19,10 @@ use std::str; use std::sync::{Arc, OnceLock}; use libc::c_void; -use ntapi::ntexapi::{SystemProcessIdInformation, SYSTEM_PROCESS_ID_INFORMATION}; +...
2
44
213
331957fc16041579e65d79350dab2b262afaf34d
Chaoses-Ib
2024-07-16T09:18:50
Fix Windows WoW64 process parent refreshing (#1314) Fix Windows WoW64 process parent refreshing --------- Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
diff --git a/src/windows/process.rs b/src/windows/process.rs index fe0ff97..95eba11 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -802,9 +802,9 @@ unsafe fn get_process_params( } let pwow32info = pwow32info.assume_init(); - if pwow32info.is_null() { - // target is a 64 bit pr...
1
13
3
9ef642dc5451880ea1b72fb371bfb724bcc8ec5f
Riccardo Busetti
2024-07-15T08:50:20
Add support for cgroup memory.stat (#1309) Add support for cgroup memory.stat
diff --git a/src/common/system.rs b/src/common/system.rs index fe46f63..219d988 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -987,6 +987,8 @@ pub struct CGroupLimits { pub free_memory: u64, /// Free swap (in bytes) for the current cgroup. pub free_swap: u64, + /// Resident Set Size ...
2
125
4
6ea781a7d405bdc5d92e4941a66cc2838545378f
Guillaume Gomez
2024-07-12T17:04:08
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 849347b..98dcc8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d92...
1
30
30
03c9aa3e855bfd789ba46667cb5618c32ef1fee1
Guillaume Gomez
2024-07-12T16:16:27
Fix new clippy lint
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 1f88f03..04d174a 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -892,7 +892,7 @@ fn parse_stat_file(data: &[u8]) -> Option<Parts<'_>> { str_parts.extend(data.split_whitespace()); Some(Parts { str_parts...
1
1
1
840ced64c488460655827422c73d958203ff45ba
Guillaume Gomez
2024-07-10T21:54:50
Make most dependencies optional
diff --git a/Cargo.toml b/Cargo.toml index e1f3af3..ff4c014 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ component = [ disk = [ "windows/Win32_Foundation", "windows/Win32_Storage_FileSystem", + "windows/Win32_Security", # For `windows::Win32::Storage::FileSystem::CreateFileW`. "windows/...
2
9
4
147a4a993dd45ad61ef7e8499ef8cee1ba97c893
avaniawang
2024-07-12T08:53:32
cargo fmt done
diff --git a/src/common/system.rs b/src/common/system.rs index 47d23dd..fe46f63 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1243,10 +1243,10 @@ impl Process { /// Returns the command line. /// /// **⚠️ Important ⚠️** - /// + /// /// On **Windows**, you might need to use ...
1
2
2
b27f91ac45757886e781923f69d87d91d02bad3a
avaniawang
2024-07-12T00:44:42
fix fmt checking errors
diff --git a/src/common/system.rs b/src/common/system.rs index 1a38209..47d23dd 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1244,10 +1244,8 @@ impl Process { /// /// **⚠️ Important ⚠️** /// - /// On **Windows**, there is one thing to know about processes's command line: - ///...
1
2
4
57dc0f87a79294d02ef50534e26709ba90f6987f
Guillaume Gomez
2024-07-08T18:38:21
Update crate version to 0.30.13
diff --git a/Cargo.lock b/Cargo.lock index 798048d..598b2ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.12" +version = "0.30.13" dependencies = [ "bstr", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index ac19fd2..05ee588 100644 ...
2
2
2
8dcce03c499e27338fdb7c88dd7925a7777a6fb1
Mark3K
2024-07-08T16:07:03
Fix segfault when call calling Components::refresh_list multiple times on M-series Mac (#1304) Fix segfault when call calling Components::refresh_list multiple times on M-series Mac
diff --git a/src/unix/apple/macos/component/arm.rs b/src/unix/apple/macos/component/arm.rs index 2bd021c..b06ffaf 100644 --- a/src/unix/apple/macos/component/arm.rs +++ b/src/unix/apple/macos/component/arm.rs @@ -3,7 +3,7 @@ use std::ffi::CStr; use core_foundation_sys::array::{CFArrayGetCount, CFArrayGetValueAtInde...
1
20
19
10fe6b22b132f0de283147756b24f0741c27e3a5
avaniawang
2024-07-08T13:18:40
fix cmd usage of granting admin privileges
diff --git a/src/common/system.rs b/src/common/system.rs index 8485487..1a38209 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1242,6 +1242,13 @@ impl Process { /// Returns the command line. /// + /// **⚠️ Important ⚠️** + /// + /// On **Windows**, there is one thing to know abo...
1
7
0
99d912ebb335568d15f88b04fa7efeb5aaf8d483
klensy
2024-07-02T15:34:45
gate ntapi under system feature
diff --git a/Cargo.toml b/Cargo.toml index 9b87924..1936ed4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ system = [ "windows/Win32_System_SystemServices", "windows/Win32_System_Threading", "windows/Win32_UI_Shell", + "ntapi", ] apple-sandbox = [] apple-app-store = ["apple-sandbox"] @@...
1
2
1
09c4933928a4904bfb32b4ece50c8527d11a25c8
Guillaume Gomez
2024-06-26T19:19:05
Fix serde feature when others are disabled
diff --git a/src/serde.rs b/src/serde.rs index 6cacdd1..8d62ceb 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -169,6 +169,7 @@ impl serde::Serialize for crate::System { } } +#[cfg(feature = "system")] impl Serialize for crate::CGroupLimits { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Erro...
1
6
0
ed2a69b4dd80d6b68ae90e9aac5cc75b6ce206cf
Guillaume Gomez
2024-06-25T18:35:49
Add `disk` feature
diff --git a/Cargo.toml b/Cargo.toml index b1df1b0..9b87924 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,13 @@ edition = "2021" name = "sysinfo" [features] -default = ["system", "multithread"] +default = ["disk", "system", "multithread"] +disk = [ + "windows/Win32_Storage_FileSystem", + "windows/Win3...
19
212
134
f44dc0456cd0a50462aef82de02fa48819de4ae4
Enaium
2024-06-28T09:22:38
Fix CPU arch retrieval on Windows (#1296) Fix CPU arch retrieval on Windows
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs index 1507d26..1830bd2 100644 --- a/src/windows/cpu.rs +++ b/src/windows/cpu.rs @@ -21,10 +21,10 @@ use windows::Win32::System::Performance::{ use windows::Win32::System::Power::{ CallNtPowerInformation, ProcessorInformation, PROCESSOR_POWER_INFORMATION, }; -u...
2
6
5
0cb406159a6452d302bdc8d420c8e66a904f837c
Guillaume Gomez
2024-06-25T18:06:49
Remove `cfg-if` dependency until PR is merged
diff --git a/Cargo.lock b/Cargo.lock index 2583e60..429b6a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,6 @@ name = "sysinfo" version = "0.30.12" dependencies = [ "bstr", - "cfg-if", "core-foundation-sys", "libc", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 0c48c6c..b1df1b0 100644 --- a/C...
12
244
16
8a34c88bfe39fff35207323f79877946ac48002f
Guillaume Gomez
2024-06-22T17:43:01
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 798048d..2583e60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,9 +98,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crat...
1
14
14
3792e54655529c80c1d18dfdeff74eda7b30e3ce
Guillaume Gomez
2024-06-22T16:27:53
Move tests to the common part where they belong
diff --git a/src/common/component.rs b/src/common/component.rs index 531934d..0c47714 100644 --- a/src/common/component.rs +++ b/src/common/component.rs @@ -292,3 +292,15 @@ impl Component { self.inner.refresh() } } + +#[cfg(test)] +mod tests { + use crate::*; + + #[test] + fn test_components_ma...
5
367
347
8c56f2be884333d7215c46065f6c9ab7ea809c93
Guillaume Gomez
2024-06-17T09:47:24
Fix new clippy lints
diff --git a/src/common/system.rs b/src/common/system.rs index 1d7add0..e85f1b2 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1508,6 +1508,9 @@ impl Process { /// information couldn't be retrieved. If you want to get the [`User`] from /// it, take a look at [`Users::get_user_by_id`]. /...
3
11
5
2a32f5d8bd89003d2a55d028cb08a95a62687e29
Gian Zellweger
2024-06-16T22:07:33
Patched #1279 and #1284 (#1285) Make `Components::refresh_list` do nothing on macOS
diff --git a/src/common/component.rs b/src/common/component.rs index a92a4a3..531934d 100644 --- a/src/common/component.rs +++ b/src/common/component.rs @@ -170,6 +170,9 @@ impl Components { /// let mut components = Components::new(); /// components.refresh_list(); /// ``` + /// + /// ⚠️ This funct...
4
26
4
3dd75d729a7379a0f7e9d6f2f98e31450e5bfe5f
Guillaume Gomez
2024-05-20T18:11:42
Update crate dependencies
diff --git a/Cargo.lock b/Cargo.lock index fc66b8c..798048d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,21 +52,21 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e4...
1
28
28
71825c07af4aeaa647b9c7a97a436a139a3a23fa
Guillaume Gomez
2024-05-20T16:09:29
Update doc linter
diff --git a/tests/code_checkers/docs.rs b/tests/code_checkers/docs.rs index 4cfdadf..44a8c6e 100644 --- a/tests/code_checkers/docs.rs +++ b/tests/code_checkers/docs.rs @@ -98,10 +98,16 @@ pub fn check_docs(content: &str, p: &Path) -> TestResult { nb_errors: 0, }; - // No need to check if we are in t...
1
10
4
29d9d417120afd2115a24b5601bf038fff2f9b0b
Guillaume Gomez
2024-05-16T09:25:49
Improve doc examples
diff --git a/src/common.rs b/src/common.rs index 429e452..8b4ac13 100644 --- a/src/common.rs +++ b/src/common.rs @@ -176,6 +176,9 @@ impl System { /// use sysinfo::System; /// /// let mut s = System::new_all(); + /// // Wait a bit because CPU usage is based on diff. + /// std::thread::sleep(sysinfo...
1
23
6
f55e9343b14e127945875aa64f7f5ca8f20b4249
ken
2024-05-15T09:12:01
fix: cargo clippy warning and error (#1274) * fix: cargo clippy warning and error * fix change try_into().unwrap() to as _
diff --git a/src/c_interface.rs b/src/c_interface.rs index 33e6649..5178959 100644 --- a/src/c_interface.rs +++ b/src/c_interface.rs @@ -108,7 +108,7 @@ pub extern "C" fn sysinfo_refresh_process(system: CSystem, pid: PID) { let mut system: Box<System> = Box::from_raw(system as *mut System); { ...
1
16
22
29b06088cd4352c6a25a2e0c216a4742e5add549
naskya
2024-05-14T10:30:35
Fix minor typo in a doc comment
diff --git a/src/common.rs b/src/common.rs index 429e452..15c527a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -823,7 +823,7 @@ impl System { /// ```no_run /// use sysinfo::System; /// - /// println!("CPU Archicture: {:?}", System::cpu_arch()); + /// println!("CPU Architecture: {:?}", System::...
1
1
1
8d62a768cfba303b4112bc9dfd7bb1bd3a0c7239
Guillaume Gomez
2024-05-05T21:24:59
Update crate version to 0.30.12
diff --git a/Cargo.lock b/Cargo.lock index 2daab1d..fc66b8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.11" +version = "0.30.12" dependencies = [ "bstr", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 29c3e1b..ac19fd2 100644 ...
2
2
2
6a1b9fc8df7882aeb7d4146c915b8132d2ab7b0d
Seo Sanghyeon
2024-05-05T17:52:06
Fix off-by-one bug in FreeBSD network implementation
diff --git a/src/unix/freebsd/network.rs b/src/unix/freebsd/network.rs index 051bb80..5757c9a 100644 --- a/src/unix/freebsd/network.rs +++ b/src/unix/freebsd/network.rs @@ -67,7 +67,7 @@ impl NetworksInner { } } let mut data: libc::ifmibdata = MaybeUninit::zeroed().assume_init(); - ...
1
1
1
7df42b96daff72e62625afbd0d91bd807168f5db
YizhePKU
2024-05-01T10:57:52
Bump windows crate to 0.56.0
diff --git a/Cargo.lock b/Cargo.lock index 11f2c09..2daab1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,9 +275,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang...
2
54
23
8fd58b8ffef41fb1e11aca27189ca1e0fb6c59ae
Guillaume Gomez
2024-04-28T19:00:15
Only store CPU usage for global CPU
diff --git a/examples/simple.rs b/examples/simple.rs index afd351c..9a12a7a 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -203,7 +203,7 @@ fn interpret_input( writeln!( &mut io::stdout(), "total CPU usage: {}%", - sys.global_cpu_info().cpu_usag...
16
177
190
71da23009db72f52a54b9776b391696bbaee1d56
Guillaume Gomez
2024-04-28T15:37:36
Always make global CPU name empty
diff --git a/src/lib.rs b/src/lib.rs index e24d707..d0f3e36 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -493,6 +493,15 @@ mod test { } } + // Ensure that the global CPU name is always empty. + #[test] + fn check_global_cpu_name() { + let mut s = System::new(); + assert_eq!(s.globa...
4
12
14
313223e75edcb87eede2dd013a5d3106c8fe5cad
Guillaume Gomez
2024-04-18T15:19:18
Update crate version to 0.30.11
diff --git a/Cargo.lock b/Cargo.lock index 8d921a5..11f2c09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.9" +version = "0.30.11" dependencies = [ "bstr", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 28be55d..f72a23a 100644 -...
2
2
2
0f8d75c7e053922171cea64ef1c51467f1ee70aa
Guillaume Gomez
2024-04-16T14:45:26
Add `System::refresh_cpu_list` method
diff --git a/src/common.rs b/src/common.rs index ba98761..e4ddd20 100644 --- a/src/common.rs +++ b/src/common.rs @@ -199,6 +199,27 @@ impl System { self.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency()) } + /// Refreshes the list of CPU. + /// + /// Normally, this should almost neve...
6
43
0
a8f8dda06cb97d67e8d2f55f50cf6f9398bdd969
Guillaume Gomez
2024-04-09T21:46:33
Add regression test for components
diff --git a/tests/components.rs b/tests/components.rs new file mode 100644 index 0000000..27cadf3 --- /dev/null +++ b/tests/components.rs @@ -0,0 +1,17 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +#[test] +fn test_components() { + use std::env::var; + + let mut c = sysin...
1
17
0
e00b455ac1cb2e1dab818e87c60cfb8860a9e426
Sheldon Young
2024-04-09T21:25:14
/sys/class/hwmon* are not directories, they are symbolic links - fixes #1245
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 60f62af..4169421 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -374,16 +374,15 @@ impl ComponentsInner { continue; }; let entry = entry.path(); - ...
1
3
4
c65673ad3c0ef52498a518bf38a5c7d6aea471ce
Guillaume Gomez
2024-04-08T20:38:47
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 3c5eb8b..8d921a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13...
6
42
28
9ded9c26ef2d80aae4de603eddc232896f539efc
Guillaume Gomez
2024-04-08T20:37:10
Update edition to 2021
diff --git a/Cargo.toml b/Cargo.toml index e3cd9be..48aa66c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" rust-version = "1.74" exclude = ["/test-unknown"] keywords = ["system-information", "disk", "process", "network", "cpu"] -edition = "2018" +edition = "2021" [lib] name = "sysi...
2
1
2