pub struct Profiler { /* private fields */ }Implementations§
Source§impl 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, )
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