Skip to content

Commit

Permalink
Merge pull request #5 from nrc/logical
Browse files Browse the repository at this point in the history
restore get_logical_cores
  • Loading branch information
nrc authored Feb 19, 2020
2 parents 2e70ddd + 56f224c commit b3b9074
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit b3b9074

Please sign in to comment.