Refactor memory and profiling CLI command groups#16
Merged
Conversation
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
memory snapshot,memory usage,memory allocation, andmemory allocation-timeline, while CPU profiling moves underprofile cpu.agent-cdp --helpoutput to top-level groups and examples so the CLI stays discoverable without dumping every leaf command.memory captureflow and its unused implementation becausememory snapshot capture --fileproduces the same snapshot artifact and remains the canonical capture path.Context
This change makes the CLI match the product taxonomy more closely: heap snapshots, heap usage sampling, and allocation analysis now sit together under
memory, and CPU profiling is isolated underprofile cpu.The implementation keeps the existing daemon IPC and analysis engines in place, but rewires command registration and help text around the nested groups. It also removes the obsolete raw snapshot code path and updates bundled docs and CLI tests to the new canonical surface.
Backward compatibility: this is an intentional breaking CLI change. The old flat commands (
mem-snapshot,js-memory,js-allocation,js-allocation-timeline,js-profile, and rawmemory capture) are removed rather than preserved as aliases. Daemon behavior, output semantics for the surviving workflows, and saved snapshot/profile artifact formats remain unchanged.Risks
memory snapshot capture --file.Manual testing
agent-cdp start,agent-cdp target list, andagent-cdp target select <id>.agent-cdp --help,agent-cdp memory --help, andagent-cdp profile cpu --helpand verify the root help is compact while subgroup help exposes the detailed command surface.agent-cdp memory snapshot capture --name baseline --gc --file /tmp/baseline.heapsnapshot, then verifyagent-cdp memory snapshot listandagent-cdp memory snapshot summarycan inspect it.agent-cdp memory usage sample --label baselineandagent-cdp memory usage summaryto confirm the nested usage commands still work against the daemon-backed state.agent-cdp memory allocation start/stop,agent-cdp memory allocation summary, andagent-cdp profile cpu start/stop/hotspotsto confirm the new command paths reach the existing analyzers.