Struct inferno::flamegraph::Options

source ·
#[non_exhaustive]
pub struct Options<'a> {
Show 30 fields pub colors: Palette, pub bgcolors: Option<BackgroundColor>, pub uicolor: Color, pub hash: bool, pub deterministic: bool, pub palette_map: Option<&'a mut PaletteMap>, pub func_frameattrs: FuncFrameAttrsMap, pub direction: Direction, pub search_color: SearchColor, pub stroke_color: StrokeColor, pub title: String, pub subtitle: Option<String>, pub image_width: Option<usize>, pub frame_height: usize, pub min_width: f64, pub font_type: String, pub font_size: usize, pub font_width: f64, pub text_truncate_direction: TextTruncateDirection, pub count_name: String, pub name_type: String, pub notes: String, pub negate_differentials: bool, pub factor: f64, pub pretty_xml: bool, pub no_sort: bool, pub reverse_stack_order: bool, pub color_diffusion: bool, pub flame_chart: bool, pub base: Vec<String>, /* private fields */
}
Expand description

Configure the flame graph.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§colors: Palette

The color palette to use when plotting.

§bgcolors: Option<BackgroundColor>

The background color for the plot.

If None, the background color will be selected based on the value of colors.

§uicolor: Color

The color of UI text such as the search and reset view button. Defaults to black

§hash: bool

Choose names based on the hashes of function names.

This will cause similar functions to be colored similarly.

§deterministic: bool

Choose names based on the hashes of function names, without the weighting scheme that hash uses.

§palette_map: Option<&'a mut PaletteMap>

Store the choice of color for each function so that later invocations use the same colors.

With this option enabled, a file called palette.map will be created the first time a flame graph is generated, and the color chosen for each function will be written into it. On subsequent invocations, functions that already have a color registered in that file will be given the stored color rather than be assigned a new one. New functions will have their colors persisted for future runs.

This feature was first implemented by Shawn Sterling.

§func_frameattrs: FuncFrameAttrsMap

Assign extra attributes to particular functions.

In particular, if a function appears in the given map, it will have extra attributes set in the resulting SVG based on its value in the map.

§direction: Direction

Whether to plot a plot that grows top-to-bottom or bottom-up (the default).

§search_color: SearchColor

The search color for flame graph.

Default value.

§stroke_color: StrokeColor

The stroke color for flame graph.

Default value.

§title: String

The title for the flame graph.

Default value.

§subtitle: Option<String>

The subtitle for the flame graph.

Defaults to None.

§image_width: Option<usize>

Width of the flame graph

Defaults to None, which means the width will be “fluid”.

§frame_height: usize

Height of each frame.

Default value.

§min_width: f64

Minimal width to omit smaller functions

Default value.

§font_type: String

The font type for the flame graph.

Default value.

§font_size: usize

Font size for the flame graph.

Default value.

§font_width: f64

Font width for the flame graph.

Default value.

§text_truncate_direction: TextTruncateDirection

When text doesn’t fit in a frame, should we cut off left side (the default) or right side?

§count_name: String

Count type label for the flame graph.

Default value.

§name_type: String

Name type label for the flame graph.

Default value.

§notes: String

The notes for the flame graph.

§negate_differentials: bool

By default, if differential samples are included in the provided stacks, the resulting flame graph will compute and show differentials as sample#2 - sample#1. If this option is set, the differential is instead computed using sample#1 - sample#2.

§factor: f64

Factor to scale sample counts by in the flame graph.

This option can be useful if the sample data has fractional sample counts since the fractional parts are stripped off when creating the flame graph. To work around this you can scale up the sample counts to be integers, then scale them back down in the graph with the factor option.

For example, if you have 23.4 as a sample count you can upscale it to 234, then set factor to 0.1.

Default value.

§pretty_xml: bool

Pretty print XML with newlines and indentation.

§no_sort: bool

Don’t sort the input lines.

If you know for sure that your folded stack lines are sorted you can set this flag to get a performance boost. If you have multiple input files, the lines will be merged and sorted regardless.

Note that if you use from_lines directly, the it is always your responsibility to make sure the lines are sorted.

§reverse_stack_order: bool

Generate stack-reversed flame graph.

Note that stack lines must always be sorted after reversing the stacks so the no_sort option will be ignored.

§color_diffusion: bool

Diffusion-based color: the wider the frame, the more red it is. This helps visually draw the eye towards frames that are wider, and therefore more likely to need to be optimized. This is redundant information, insofar as it’s the same as the width of frames, but it still provides a useful visual cue of what to focus on, especially if you are showing flamegraphs to someone for the first time.

§flame_chart: bool

Produce a flame chart (sort by time, do not merge stacks)

Note that stack is not sorted and will be reversed

§base: Vec<String>

Base symbols

Trait Implementations§

source§

impl<'a> Debug for Options<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Options<'a>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a> PartialEq for Options<'a>

source§

fn eq(&self, other: &Options<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> StructuralPartialEq for Options<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Options<'a>

§

impl<'a> RefUnwindSafe for Options<'a>

§

impl<'a> Send for Options<'a>

§

impl<'a> Sync for Options<'a>

§

impl<'a> Unpin for Options<'a>

§

impl<'a> !UnwindSafe for Options<'a>

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.