pub struct Flamegrapher { /* private fields */ }
Expand description
Helper struct that uses inferno
internally to programatically produce a flamegraph from a folded
stack trace file.
Implementations§
Source§impl Flamegrapher
impl Flamegrapher
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Flamegrapher
with no associated files.
Sourcepub fn with_stack_file<P: AsRef<Path>>(
self,
stack_filename: P,
) -> Result<Self, Error>
pub fn with_stack_file<P: AsRef<Path>>( self, stack_filename: P, ) -> Result<Self, Error>
Returns a Flamegrapher
with the given folded stack file name.
§Errors
This method may fail in the following ways:
- The given stack file does not exist.
Sourcepub fn with_graph_file<P: AsRef<Path>>(
self,
graph_filename: P,
) -> Result<Self, Error>
pub fn with_graph_file<P: AsRef<Path>>( self, graph_filename: P, ) -> Result<Self, Error>
Returns a Flamegrapher
with the given flamegraph file name.
This file will be given the extension of .svg
.
§Errors
This method may fail in the following ways:
- The given graph filename is invalid (it does not belong to a directory that exists).
Sourcepub fn write_flamegraph(&self) -> Result<(), Error>
pub fn write_flamegraph(&self) -> Result<(), Error>
Uses inferno
to generate a flamegraph from the given folded stack file, and writes it to the given
output image file.
§Errors
This method may fail in the following ways:
- This
Flamegrapher
does not have a stack or graph file associated with it. - An error was encountered when opening the folded stack file for reading.
- An error was encountered when creating the graph file.
Trait Implementations§
Source§impl Default for Flamegrapher
impl Default for Flamegrapher
Source§fn default() -> Flamegrapher
fn default() -> Flamegrapher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Flamegrapher
impl RefUnwindSafe for Flamegrapher
impl Send for Flamegrapher
impl Sync for Flamegrapher
impl Unpin for Flamegrapher
impl UnwindSafe for Flamegrapher
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