pub struct SessionTrackingInfo {
pub session_id: SessionId,
pub branch: Option<BranchContext>,
pub last_activity: Instant,
pub transaction_depth: u32,
pub ai_context: AIWorkloadContext,
pub query_count: u64,
pub cache_hits: u64,
}Expand description
Session tracking for TWR integration
Fields§
§session_id: SessionIdSession identifier
branch: Option<BranchContext>Active branch context
last_activity: InstantLast query time
transaction_depth: u32Transaction depth (0 = not in transaction)
ai_context: AIWorkloadContextAI workload context
query_count: u64Total queries in session
cache_hits: u64Cache hit count
Implementations§
Source§impl SessionTrackingInfo
impl SessionTrackingInfo
Sourcepub fn with_branch(self, branch: BranchContext) -> Self
pub fn with_branch(self, branch: BranchContext) -> Self
Set branch context
Sourcepub fn with_ai_context(self, context: AIWorkloadContext) -> Self
pub fn with_ai_context(self, context: AIWorkloadContext) -> Self
Set AI context
Sourcepub fn record_query(&mut self)
pub fn record_query(&mut self)
Record a query
Sourcepub fn record_cache_hit(&mut self)
pub fn record_cache_hit(&mut self)
Record a cache hit
Sourcepub fn cache_hit_rate(&self) -> f64
pub fn cache_hit_rate(&self) -> f64
Get cache hit rate
Trait Implementations§
Source§impl Clone for SessionTrackingInfo
impl Clone for SessionTrackingInfo
Source§fn clone(&self) -> SessionTrackingInfo
fn clone(&self) -> SessionTrackingInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionTrackingInfo
impl RefUnwindSafe for SessionTrackingInfo
impl Send for SessionTrackingInfo
impl Sync for SessionTrackingInfo
impl Unpin for SessionTrackingInfo
impl UnsafeUnpin for SessionTrackingInfo
impl UnwindSafe for SessionTrackingInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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