Study Landmarks package: comparison doc and profile command (#27)#101
Study Landmarks package: comparison doc and profile command (#27)#101
Conversation
Study the Landmarks package (issue #27): add LANDMARKS_COMPARISON.md documenting overlap, differences, and inspiration points. Implement a `profile` command in minidebug_view that aggregates timing data by function name using SQL, inspired by Landmarks' aggregate_landmarks. Includes regression test and updated help text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a324ddb501
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| LEFT JOIN value_atoms va_loc ON e.location_value_id = va_loc.value_id | ||
| WHERE e.elapsed_end_ns IS NOT NULL | ||
| AND e.child_scope_id IS NOT NULL | ||
| AND e.seq_id = 0 |
There was a problem hiding this comment.
Drop seq_id=0 constraint in profile aggregation
In get_profiling_summary, filtering with e.seq_id = 0 makes the profile include only the first child entry of each parent scope, so sibling calls are silently excluded from call_count, total_ns, and ordering. This breaks accuracy whenever a function body performs multiple instrumented calls (or when root scope has multiple top-level calls), because only one of those calls is aggregated while the rest are ignored.
Useful? React with 👍 / 👎.
Summary
LANDMARKS_COMPARISON.mddocumenting the overlap between ppx_minidebug and the Landmarks profiling library, including 6 concrete inspiration points and a recommendation against adding Landmarks as a dependency.profilecommand tominidebug_viewthat aggregates timing data by function name and location using SQL, inspired by Landmarks'aggregate_landmarks. Supports--format=jsonand--limit.filter_test_output.mlto handle bare (non-angle-bracketed) time spans in test output.Closes #27
Test plan
dune buildcompiles cleanly with no warningsdune runtestpasses all existing tests plus the new profile testminidebug_view <db> profileproduces correct aggregated outputminidebug_view <db> profile --format=jsonproduces valid JSONminidebug_view <db> profile --limit=1limits output correctly🤖 Generated with Claude Code