pub struct Tracer { /* private fields */ }Expand description
Performance tracer that collects timing information
Implementations§
Source§impl Tracer
impl Tracer
Sourcepub fn begin_with_args(
&mut self,
name: &str,
category: &str,
args: FxHashMap<String, Value>,
)
pub fn begin_with_args( &mut self, name: &str, category: &str, args: FxHashMap<String, Value>, )
Begin a duration event with arguments
Sourcepub fn complete(
&mut self,
name: &str,
category: &str,
start: Instant,
duration: Duration,
)
pub fn complete( &mut self, name: &str, category: &str, start: Instant, duration: Duration, )
Record a complete event with known duration
Sourcepub fn complete_with_args(
&mut self,
name: &str,
category: &str,
start: Instant,
duration: Duration,
args: FxHashMap<String, Value>,
)
pub fn complete_with_args( &mut self, name: &str, category: &str, start: Instant, duration: Duration, args: FxHashMap<String, Value>, )
Record a complete event with arguments
Sourcepub fn instant_with_args(
&mut self,
name: &str,
category: &str,
args: FxHashMap<String, Value>,
)
pub fn instant_with_args( &mut self, name: &str, category: &str, args: FxHashMap<String, Value>, )
Record an instant event with arguments
Sourcepub fn metadata(&mut self, name: &str, args: FxHashMap<String, Value>)
pub fn metadata(&mut self, name: &str, args: FxHashMap<String, Value>)
Add metadata event (e.g., process/thread names)
Sourcepub fn write_to_file(&self, path: &Path) -> Result<()>
pub fn write_to_file(&self, path: &Path) -> Result<()>
Write the trace to a file
Sourcepub fn events(&self) -> &[TraceEvent]
pub fn events(&self) -> &[TraceEvent]
Get all recorded events
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tracer
impl RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl UnsafeUnpin for Tracer
impl UnwindSafe for Tracer
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