Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore get_logical_cores #5

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/sysinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ pub extern crate pnet_datalink as datalink;
pub use common::{AsU32, DiskType, NetworksIter, Pid, RefreshKind};
pub use io::IOLoad;
pub use net::NICLoad;
pub use num_cpus::get_physical as get_physical_cores;
pub use sys::{
Component, Disk, NetworkData, Networks, Process,
ProcessStatus, Processor, System,
};
pub use num_cpus::{get as get_logical_cores, get_physical as get_physical_cores};
pub use sys::{Component, Disk, NetworkData, Networks, Process, ProcessStatus, Processor, System};
pub use traits::{
ComponentExt, DiskExt, NetworkExt, NetworksExt, ProcessExt, ProcessorExt, SystemExt,
};
Expand Down Expand Up @@ -290,6 +287,11 @@ mod test {
println!("test test_io_load: {:?}", ::IOLoad::snapshot());
}

#[test]
fn test_get_logical_cores() {
assert_ne!(::get_logical_cores(), 0, "expect none-zero logical core");
}

#[test]
fn test_get_cores() {
assert_ne!(::get_physical_cores(), 0, "expect none-zero physical core");
Expand Down