mix raxol.flamegraph (Raxol v2.6.0)

View Source

Generate flame graphs for performance analysis.

Flame graphs visualize profiling data as interactive SVG images, making it easy to identify performance bottlenecks.

Usage

mix raxol.flamegraph MODULE [OPTIONS]
mix raxol.flamegraph --function MODULE.function/arity [OPTIONS]
mix raxol.flamegraph --info

Examples

# Profile a module for 5 seconds
mix raxol.flamegraph Raxol.Terminal.Buffer

# Profile with custom duration
mix raxol.flamegraph Raxol.Terminal.Buffer --duration 10000

# Profile a specific function
mix raxol.flamegraph --function Raxol.Terminal.Buffer.write/3

# Check available tools
mix raxol.flamegraph --info

# Custom output path
mix raxol.flamegraph Raxol.UI.Renderer --output ./profiling/renderer.svg

Options

  • --duration MS - Profiling duration in milliseconds (default: 5000)
  • --output PATH - Output file path (default: MODULE_flamegraph.svg)
  • --title TITLE - Title for the flame graph
  • --width PIXELS - SVG width (default: 1200)
  • --format FORMAT - Output format: svg, folded, fprof (default: svg)
  • --info - Show available profiling tools
  • --function MFA - Profile a specific function call

Output

By default, generates an SVG file that can be opened in any web browser. The SVG is interactive - hover to see function names and click to zoom.

Requirements

For SVG generation, install brendangregg/FlameGraph:

git clone https://github.com/brendangregg/FlameGraph
export PATH=$PATH:/path/to/FlameGraph

Without this, output is saved in folded stack format which can be converted to SVG later.