pub struct ProfileSession { /* private fields */ }Expand description
Streaming profiler session writing JSONL runtime v3 events.
Implementations§
Source§impl ProfileSession
impl ProfileSession
Sourcepub fn open(path: impl AsRef<Path>, config: ProfileConfig) -> Result<Self>
pub fn open(path: impl AsRef<Path>, config: ProfileConfig) -> Result<Self>
Open (or truncate) a JSONL profile trace at path.
pub fn phase(&self) -> ExecutionPhase
pub fn step(&self) -> u64
pub fn set_step(&mut self, step: u64)
Sourcepub fn begin_operation(
&mut self,
static_id: impl Into<String>,
op: impl Into<String>,
inputs: &[String],
) -> Result<String>
pub fn begin_operation( &mut self, static_id: impl Into<String>, op: impl Into<String>, inputs: &[String], ) -> Result<String>
Begin timing an operation; returns an event_id for Self::end_operation.
Sourcepub fn end_operation(
&mut self,
event_id: &str,
output: Option<String>,
) -> Result<u64>
pub fn end_operation( &mut self, event_id: &str, output: Option<String>, ) -> Result<u64>
End a timed operation and emit a runtime v3 operation observation.
Sourcepub fn record_edge_timing(
&mut self,
from_static_id: impl Into<String>,
to_static_id: impl Into<String>,
duration_ns: u64,
) -> Result<()>
pub fn record_edge_timing( &mut self, from_static_id: impl Into<String>, to_static_id: impl Into<String>, duration_ns: u64, ) -> Result<()>
Record average-friendly edge timing between two static tensor/operation ids.
pub fn flush(&mut self) -> Result<()>
pub fn finish(self) -> Result<PathBuf>
Auto Trait Implementations§
impl Freeze for ProfileSession
impl RefUnwindSafe for ProfileSession
impl Send for ProfileSession
impl Sync for ProfileSession
impl Unpin for ProfileSession
impl UnsafeUnpin for ProfileSession
impl UnwindSafe for ProfileSession
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