Struct trace_tools::util::Flamegrapher
source · [−]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
sourceimpl 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
sourceimpl Default for Flamegrapher
impl Default for Flamegrapher
sourcefn default() -> Flamegrapher
fn default() -> Flamegrapher
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for Flamegrapher
impl Send for Flamegrapher
impl Sync for Flamegrapher
impl Unpin for Flamegrapher
impl UnwindSafe for Flamegrapher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more