pub struct SystemRunner { /* private fields */ }Expand description
Runner for collecting system resource metrics (CPU and memory)
Implementations§
Source§impl SystemRunner
impl SystemRunner
Sourcepub fn new() -> SystemRunner
pub fn new() -> SystemRunner
Create a new system runner with default configuration
Sourcepub fn interval(self, secs: u64) -> SystemRunner
pub fn interval(self, secs: u64) -> SystemRunner
Set the monitoring interval in seconds
Sourcepub fn pid(self, pid: u32) -> SystemRunner
pub fn pid(self, pid: u32) -> SystemRunner
Monitor a specific PID
Sourcepub fn comm(self, comm: impl Into<String>) -> SystemRunner
pub fn comm(self, comm: impl Into<String>) -> SystemRunner
Monitor processes by name
Sourcepub fn session(self, session_id: u32) -> SystemRunner
pub fn session(self, session_id: u32) -> SystemRunner
Monitor a process session.
Sourcepub fn include_children(self, include: bool) -> SystemRunner
pub fn include_children(self, include: bool) -> SystemRunner
Include child processes in metrics aggregation
Sourcepub fn cpu_threshold(self, threshold: f64) -> SystemRunner
pub fn cpu_threshold(self, threshold: f64) -> SystemRunner
Set CPU usage threshold for alerts (%)
Sourcepub fn memory_threshold(self, threshold: u64) -> SystemRunner
pub fn memory_threshold(self, threshold: u64) -> SystemRunner
Set memory usage threshold for alerts (MB)
Trait Implementations§
Source§impl Default for SystemRunner
impl Default for SystemRunner
Source§fn default() -> SystemRunner
fn default() -> SystemRunner
Returns the “default value” for a type. Read more
Source§impl Runner for SystemRunner
impl Runner for SystemRunner
fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Event> + Send>>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
SystemRunner: 'async_trait,
fn add_analyzer(self, analyzer: Box<dyn Analyzer>) -> SystemRunner
Auto Trait Implementations§
impl !RefUnwindSafe for SystemRunner
impl !UnwindSafe for SystemRunner
impl Freeze for SystemRunner
impl Send for SystemRunner
impl Sync for SystemRunner
impl Unpin for SystemRunner
impl UnsafeUnpin for SystemRunner
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