MCPcopy Create free account
hub / github.com/vercel/vercel / generate_flamegraph

Function generate_flamegraph

packages/python-analysis/scripts/profile-wasm.py:446–461  ·  view source on GitHub ↗

Generate a flamegraph SVG using inferno-flamegraph.

(folded_stacks, output_path, title)

Source from the content-addressed store, hash-verified

444
445
446def generate_flamegraph(folded_stacks, output_path, title):
447 """Generate a flamegraph SVG using inferno-flamegraph."""
448 if not folded_stacks.strip():
449 return False
450
451 svg = run(
452 [
453 "inferno-flamegraph",
454 "--title", title,
455 "--countname", "bytes",
456 "--nametype", "Item:",
457 ],
458 input=folded_stacks,
459 )
460 output_path.write_text(svg)
461 return True
462
463
464# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls 3

stripMethod · 0.80
write_textMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected