Skip to main content

resq-flame

Version: v0.1.16 · License: Apache-2.0 · Crate: crates.io · API docs: docs.rs
SVG CPU flame graph profiler for ResQ services

Overview

Crates.io License Interactive CPU profiler and SVG flame graph generator for ResQ services. Provides a TUI for selecting profiling targets and a subcommand interface for scripted profiling, piping output through inferno-flamegraph.

Overview

resq-flame supports multiple profiling backends (V8 CPU profiles, pprof, py-spy, Linux perf) and converts their output into the folded-stack format consumed by inferno. The result is an interactive SVG flame graph you can open in any browser.

Profiling Pipeline

Installation

Prerequisites

CLI Arguments

Global Flags

Subcommand: hce

Fetch a V8 CPU profile from the Coordination HCE server.

Usage Examples

Interactive TUI (default)

Use arrow keys or j/k to navigate, Enter to start profiling the selected target, and q or Esc to quit.

Subcommand Mode

Profiling Targets (TUI)

TUI Keybindings

Environment Variables

Output Format

The tool generates interactive SVG flame graphs using the inferno crate:
  • Folded stacks are the intermediate format (frame1;frame2;frameN count).
  • SVG output supports interactive features when opened in a browser: click to zoom, Ctrl+F to search.

Input Format Support

Reading Flame Graphs

  • Width of a frame = proportion of total samples where that function was on the stack
  • Height = call depth (bottom is root, top is leaf)
  • Wide frames at the top = hot leaf functions (primary optimization targets)
  • Wide frames in the middle = called frequently from many paths

Safety Notes

  • Profiling is read-only — it does not modify the target service.
  • External profiler binaries (py-spy, perf) are invoked as subprocesses; the tool handles missing binaries gracefully.
  • Use reasonable durations when profiling production environments to minimize overhead.
  • The HCE subcommand connects via HTTP and does not require kernel-level access.
  • perf mode requires appropriate Linux capabilities (CAP_SYS_ADMIN or perf_event_paranoid settings).

Typical Workflow

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.