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
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.
stroke_color: StrokeColor
The stroke color for flame graph.
title: String
The title for the flame graph.
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.
min_width: f64
Minimal width to omit smaller functions
font_type: String
The font type for the flame graph.
font_size: usize
Font size for the flame graph.
font_width: f64
Font width for the flame graph.
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.
name_type: String
Name type label for the flame graph.
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
.
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