Struct measureme::Profiler

source ·
pub struct Profiler { /* private fields */ }

Implementations§

source§

impl Profiler

source

pub fn new<P: AsRef<Path>>( path_stem: P ) -> Result<Profiler, Box<dyn Error + Send + Sync>>

source

pub fn with_counter<P: AsRef<Path>>( path_stem: P, counter: Counter ) -> Result<Profiler, Box<dyn Error + Send + Sync>>

source

pub fn map_virtual_to_concrete_string( &self, virtual_id: StringId, concrete_id: StringId )

source

pub fn bulk_map_virtual_to_single_concrete_string<I>( &self, virtual_ids: I, concrete_id: StringId )
where I: Iterator<Item = StringId> + ExactSizeIterator,

source

pub fn alloc_string<STR: SerializableString + ?Sized>( &self, s: &STR ) -> StringId

source

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.

source

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.

source

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.

source

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.

source

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.