pub struct ProcessMonitor { /* private fields */ }Expand description
Process monitor for tracking sandbox resource usage
Implementations§
Source§impl ProcessMonitor
impl ProcessMonitor
Sourcepub fn collect_stats(&mut self) -> Result<ProcessStats>
pub fn collect_stats(&mut self) -> Result<ProcessStats>
Collect current statistics
Sourcepub fn peak_memory_mb(&self) -> u64
pub fn peak_memory_mb(&self) -> u64
Get peak memory usage since monitor creation (in MB)
Sourcepub fn send_sigterm(&self) -> Result<()>
pub fn send_sigterm(&self) -> Result<()>
Send SIGTERM (graceful shutdown)
Sourcepub fn send_sigkill(&self) -> Result<()>
pub fn send_sigkill(&self) -> Result<()>
Send SIGKILL (force termination)
Sourcepub fn graceful_shutdown(&self, wait_duration: Duration) -> Result<()>
pub fn graceful_shutdown(&self, wait_duration: Duration) -> Result<()>
Graceful shutdown: SIGTERM → wait → SIGKILL
Sourcepub fn last_stats(&self) -> Option<&ProcessStats>
pub fn last_stats(&self) -> Option<&ProcessStats>
Get last collected stats
Auto Trait Implementations§
impl Freeze for ProcessMonitor
impl RefUnwindSafe for ProcessMonitor
impl Send for ProcessMonitor
impl Sync for ProcessMonitor
impl Unpin for ProcessMonitor
impl UnwindSafe for ProcessMonitor
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