pub struct SessionMetricsClient { /* private fields */ }Expand description
HTTP client for pushing session metrics to JanusAI.
Construct once at startup with from_env() and share via Arc.
Implementations§
Source§impl SessionMetricsClient
impl SessionMetricsClient
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Build a client from environment variables.
Reads JANUS_AI_URL (e.g. http://fks_janus_ai:8000). When unset,
returns a disabled client whose push() is a debug-logged no-op.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
True when the client will actually attempt a network call.
Sourcepub async fn push(&self, session_id: &str, metrics: &SessionMetrics)
pub async fn push(&self, session_id: &str, metrics: &SessionMetrics)
Push a metrics snapshot for session_id. Errors are logged and
swallowed — metric push must never break the signal pipeline.
Trait Implementations§
Source§impl Clone for SessionMetricsClient
impl Clone for SessionMetricsClient
Source§fn clone(&self) -> SessionMetricsClient
fn clone(&self) -> SessionMetricsClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionMetricsClient
impl Debug for SessionMetricsClient
Auto Trait Implementations§
impl Freeze for SessionMetricsClient
impl !RefUnwindSafe for SessionMetricsClient
impl Send for SessionMetricsClient
impl Sync for SessionMetricsClient
impl Unpin for SessionMetricsClient
impl UnsafeUnpin for SessionMetricsClient
impl !UnwindSafe for SessionMetricsClient
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