pub struct CpuLoad { /* private fields */ }Expand description
CPU Load Monitor CPU 负载监控器
Implementations§
Source§impl CpuLoad
impl CpuLoad
Sourcepub fn init(interval: Duration) -> Self
pub fn init(interval: Duration) -> Self
Create monitor and start background sampling task 创建监控器并启动后台采样任务
Sourcepub fn idlest(&self) -> usize
pub fn idlest(&self) -> usize
Get the index of the idlest CPU core (Round-Robin with periodic re-sort) 获取最空闲的 CPU 核心索引(轮询 + 周期性重排序)
Trait Implementations§
Source§impl Generator<CpuLoad> for __StaticInitGeneratorFor_CPU_LOAD
Available on (Linux or Android or FreeBSD or DragonFly BSD or NetBSD or OpenBSD or Solaris or illumos or Emscripten or Haiku or L4Re or Fuchsia or Redox or target_os=vxworks), or Windows, or (macOS or iOS) only.
impl Generator<CpuLoad> for __StaticInitGeneratorFor_CPU_LOAD
Available on (Linux or Android or FreeBSD or DragonFly BSD or NetBSD or OpenBSD or Solaris or illumos or Emscripten or Haiku or L4Re or Fuchsia or Redox or
target_os=vxworks), or Windows, or (macOS or iOS) only.Auto Trait Implementations§
impl !Freeze for CpuLoad
impl RefUnwindSafe for CpuLoad
impl Send for CpuLoad
impl Sync for CpuLoad
impl Unpin for CpuLoad
impl !UnwindSafe for CpuLoad
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more