pub struct ScopedProfiler {}
Expand description
Facade for cpuprofiler::PROFILER
to cope with the optional gperftools dependency and to
ensure profiling stops on drop
.
Implementations§
Source§impl ScopedProfiler
impl ScopedProfiler
Sourcepub fn start<P: AsRef<Path>>(path: P) -> Fallible<ScopedProfiler>
pub fn start<P: AsRef<Path>>(path: P) -> Fallible<ScopedProfiler>
Starts the CPU profiler and stores the profile in the given path
.
This will fail if sandboxfs was built without the “profiler” feature. This may fail if there are problems initializing the profiler.
Note that, due to the nature of profiling, there can only be one ScopedPointer
active at
any given time. Trying to create two instances of this will cause this method to block
until the other object is dropped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopedProfiler
impl RefUnwindSafe for ScopedProfiler
impl Send for ScopedProfiler
impl Sync for ScopedProfiler
impl Unpin for ScopedProfiler
impl UnwindSafe for ScopedProfiler
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