pub struct TensorExecutionTracer {
pub events: Vec<TraceEvent>,
pub next_event_id: u64,
pub config: TracerConfig,
/* private fields */
}Expand description
Records detailed execution traces of TensorLogic inference operations.
The tracer maintains a capped ring buffer of TraceEvents. When the
buffer reaches config.max_events, the oldest event is evicted and
dropped_events is incremented.
Fields§
§events: Vec<TraceEvent>Retained events (oldest-first).
next_event_id: u64The event_id that will be assigned to the next recorded event.
config: TracerConfigTracer configuration.
Implementations§
Source§impl TensorExecutionTracer
impl TensorExecutionTracer
Sourcepub fn new(config: TracerConfig) -> Self
pub fn new(config: TracerConfig) -> Self
Creates a new tracer with the supplied configuration.
Sourcepub fn record(&mut self, session_id: u64, tick: u64, kind: TraceEventKind)
pub fn record(&mut self, session_id: u64, tick: u64, kind: TraceEventKind)
Records an event.
- If
config.enabledisfalsethe call is a no-op. - If the buffer is already at capacity the oldest event is removed and
dropped_eventsis incremented before the new event is appended.
Sourcepub fn events_for_session(&self, session_id: u64) -> Vec<&TraceEvent>
pub fn events_for_session(&self, session_id: u64) -> Vec<&TraceEvent>
Returns all events belonging to session_id, in chronological order.
Sourcepub fn summarize_session(&self, session_id: u64) -> TraceSummary
pub fn summarize_session(&self, session_id: u64) -> TraceSummary
Computes aggregated statistics for session_id.
Sourcepub fn clear_session(&mut self, session_id: u64)
pub fn clear_session(&mut self, session_id: u64)
Removes all events that belong to session_id.
Sourcepub fn all_sessions(&self) -> Vec<u64>
pub fn all_sessions(&self) -> Vec<u64>
Returns a sorted, deduplicated list of all session identifiers present in the current event buffer.
Sourcepub fn stats(&self) -> TracerStats
pub fn stats(&self) -> TracerStats
Returns aggregate statistics across all sessions.
Auto Trait Implementations§
impl Freeze for TensorExecutionTracer
impl RefUnwindSafe for TensorExecutionTracer
impl Send for TensorExecutionTracer
impl Sync for TensorExecutionTracer
impl Unpin for TensorExecutionTracer
impl UnsafeUnpin for TensorExecutionTracer
impl UnwindSafe for TensorExecutionTracer
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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