pub struct Profiler { /* private fields */ }
Implementations
sourceimpl Profiler
impl Profiler
pub fn new<P: AsRef<Path>>(
path_stem: P
) -> Result<Profiler, Box<dyn Error + Send + Sync>>
pub fn with_counter<P: AsRef<Path>>(
path_stem: P,
counter: Counter
) -> Result<Profiler, Box<dyn Error + Send + Sync>>
pub fn map_virtual_to_concrete_string(
&self,
virtual_id: StringId,
concrete_id: StringId
)
pub fn bulk_map_virtual_to_single_concrete_string<I>(
&self,
virtual_ids: I,
concrete_id: StringId
) where
I: Iterator<Item = StringId> + ExactSizeIterator,
pub fn alloc_string<STR: SerializableString + ?Sized>(
&self,
s: &STR
) -> StringId
sourcepub fn record_instant_event(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
)
pub fn record_instant_event(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
)
Records an event with the given parameters. The event time is computed automatically.
sourcepub fn record_integer_event(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32,
value: u64
)
pub fn record_integer_event(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32,
value: u64
)
Records an event with the given parameters. The event time is computed automatically.
sourcepub fn start_recording_interval_event<'a>(
&'a self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
) -> TimingGuard<'a>
pub fn start_recording_interval_event<'a>(
&'a self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
) -> TimingGuard<'a>
Creates a “start” event and returns a TimingGuard
that will create
the corresponding “end” event when it is dropped.
sourcepub fn start_recording_interval_event_detached(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
) -> DetachedTiming
pub fn start_recording_interval_event_detached(
&self,
event_kind: StringId,
event_id: EventId,
thread_id: u32
) -> DetachedTiming
Creates a “start” event and returns a DetachedTiming
.
To create the corresponding “event” event, you must call
finish_recording_internal_event
with the returned
DetachedTiming
.
Since DetachedTiming
does not capture the lifetime of &self
,
this method can sometimes be more convenient than
start_recording_interval_event
- e.g. it can be stored
in a struct without the need to add a lifetime parameter.
sourcepub fn finish_recording_interval_event(&self, timing: DetachedTiming)
pub fn finish_recording_interval_event(&self, timing: DetachedTiming)
Creates the corresponding “end” event for
the “start” event represented by timing
. You
must have obtained timing
from the same Profiler
Auto Trait Implementations
impl !RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl !UnwindSafe for Profiler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more