Struct inferno::flamegraph::Options[][src]

#[non_exhaustive]pub struct Options<'a> {
    pub colors: Palette,
    pub bgcolors: Option<BackgroundColor>,
    pub hash: bool,
    pub palette_map: Option<&'a mut PaletteMap>,
    pub func_frameattrs: FuncFrameAttrsMap,
    pub direction: Direction,
    pub search_color: SearchColor,
    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,
    // some fields omitted
}

Configure the flame graph.

Fields (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.

hash: bool

Choose names based on the hashes of function names.

This will cause similar functions to be colored similarly.

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.

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_sorted_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

Trait Implementations

impl<'a> Debug for Options<'a>[src]

impl<'a> Default for Options<'a>[src]

impl<'a> PartialEq<Options<'a>> for Options<'a>[src]

impl<'a> StructuralPartialEq for Options<'a>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.