Add pprof-to-md integration for LLM-friendly markdown analysis#58
Merged
Add pprof-to-md integration for LLM-friendly markdown analysis#58
Conversation
Integrates pprof-to-md to generate markdown analysis files alongside existing HTML flamegraphs and pb files, making profile data more accessible to LLMs and automated analysis tools. Changes: - Added pprof-to-md dependency and bumped Node.js requirement to >=22.6.0 - Implemented generateMarkdown() function in lib/index.js - Extended preload.js to generate markdown files automatically - Added --md-format CLI flag supporting summary/detailed/adaptive modes - Added comprehensive test coverage (8 new tests across unit/integration) - Updated documentation with markdown generation examples and usage The markdown format provides structured, readable profile analysis that can be easily consumed by LLMs, while maintaining full backward compatibility with existing HTML and pb output formats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR integrates pprof-to-md to generate LLM-friendly markdown analysis files alongside the existing HTML flamegraphs and pb files. This makes profile data more accessible to LLMs and automated analysis tools while maintaining full backward compatibility.
Key Features
.mdfiles alongside HTML flamegraphs--md-formatflag:summary: Overview with top functions (default)detailed: Full call stacks and comprehensive dataadaptive: Intelligent format selection based on profile sizeChanges Implemented
Dependencies & Requirements (
package.json)pprof-to-mddependency>=22.6.0Core Library (
lib/index.js)generateMarkdown()function with format supportgenerateFlamegraph()APIPreload Script (
preload.js)CLI Enhancement (
bin/flame.js)--md-formatflag forrunandgeneratecommandsDocumentation (
README.md)--md-formatflag usageTest Coverage
test/lib.test.jsforgenerateMarkdown()test/cli.test.jsfor--md-formatflagtest/integration.test.jsTest Plan
Example Usage
Related Documentation
🤖 Generated with Claude Code