pub struct SessionMonitor { /* private fields */ }Expand description
Session monitor for background process monitoring
This is the SECONDARY layer of detection with ~95% reliability.
Implementations§
Source§impl SessionMonitor
impl SessionMonitor
Sourcepub fn with_polling_interval(self, interval: Duration) -> Self
pub fn with_polling_interval(self, interval: Duration) -> Self
Set polling interval
Sourcepub fn with_inactivity_threshold(self, threshold: Duration) -> Self
pub fn with_inactivity_threshold(self, threshold: Duration) -> Self
Set inactivity threshold
Sourcepub fn subscribe(&self) -> Receiver<MonitorEvent>
pub fn subscribe(&self) -> Receiver<MonitorEvent>
Subscribe to monitor events
Sourcepub async fn start_monitoring(&self, agent_types: Vec<AgentType>)
pub async fn start_monitoring(&self, agent_types: Vec<AgentType>)
Start monitoring for specific agent types
Sourcepub async fn stop_monitoring(&self)
pub async fn stop_monitoring(&self)
Stop monitoring
Sourcepub async fn record_activity(&self, agent_type: &str)
pub async fn record_activity(&self, agent_type: &str)
Record activity for an agent
Sourcepub async fn is_inactive(&self, agent_type: &str) -> bool
pub async fn is_inactive(&self, agent_type: &str) -> bool
Check if agent has been inactive
Sourcepub async fn get_inactive_duration(&self, agent_type: &str) -> Option<Duration>
pub async fn get_inactive_duration(&self, agent_type: &str) -> Option<Duration>
Get inactive duration for an agent
Sourcepub async fn detect_activity(
&self,
agent_type: AgentType,
) -> Result<SessionActivity>
pub async fn detect_activity( &self, agent_type: AgentType, ) -> Result<SessionActivity>
Detect session activity for an agent
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionMonitor
impl !RefUnwindSafe for SessionMonitor
impl Send for SessionMonitor
impl Sync for SessionMonitor
impl Unpin for SessionMonitor
impl UnsafeUnpin for SessionMonitor
impl !UnwindSafe for SessionMonitor
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