#[non_exhaustive]pub struct Options<'a> {Show 30 fields
pub colors: Palette,
pub bgcolors: Option<BackgroundColor>,
pub uicolor: Rgb<u8>,
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: PaletteThe 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: Rgb<u8>The color of UI text such as the search and reset view button. Defaults to black
hash: boolChoose names based on the hashes of function names.
This will cause similar functions to be colored similarly.
deterministic: boolChoose 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: FuncFrameAttrsMapAssign 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: DirectionWhether to plot a plot that grows top-to-bottom or bottom-up (the default).
search_color: SearchColorThe search color for flame graph.
stroke_color: StrokeColorThe stroke color for flame graph.
title: StringThe 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: usizeHeight of each frame.
min_width: f64Minimal width to omit smaller functions
font_type: StringThe font type for the flame graph.
font_size: usizeFont size for the flame graph.
font_width: f64Font width for the flame graph.
text_truncate_direction: TextTruncateDirectionWhen text doesn’t fit in a frame, should we cut off left side (the default) or right side?
count_name: StringCount type label for the flame graph.
name_type: StringName type label for the flame graph.
notes: StringThe notes for the flame graph.
negate_differentials: boolBy 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: f64Factor 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: boolPretty print XML with newlines and indentation.
no_sort: boolDon’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: boolGenerate 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: boolDiffusion-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: boolProduce 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§
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> 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more