feat: Add MCP tools for heap snapshot comparison#2198
Open
dinfuehr wants to merge 1 commit into
Open
Conversation
9ba38a1 to
21e6969
Compare
4965039 to
da38526
Compare
da38526 to
d64820a
Compare
d64820a to
69dedbb
Compare
69dedbb to
1fffe65
Compare
Collaborator
Author
|
I've rebased the PR again. Should be ready for review again. |
Lightning00Blade
approved these changes
Jun 26, 2026
Lightning00Blade
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, with 2 small comments.
| `Invalid classIndex: ${classIndex}. Total classes with changes: ${classDiffs.length}`, | ||
| ); | ||
| } | ||
| const rawDiff = result; |
Collaborator
There was a problem hiding this comment.
Nit, not needed reassign
| // as a cache key. We pass the unique diffCacheKey we generated when loading | ||
| // the base snapshot. | ||
| const rawDiffs = await currentSnapshot.calculateSnapshotDiff( | ||
| cachedBaseSnapshot.diffCacheKey, |
Collaborator
There was a problem hiding this comment.
I think I overlook the UID we provide as at time it did not matter and it's currently hard-coded for all to 1 (workerProxy.createLoader).
Let's update that part and pull the value from the uid like DevTools done.
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.
This commit adds two MCP tools for comparing heap snapshots.
compare_heapsnapshot_summarycompares two memory snapshot and returns which classes have new/deleted objects.compare_heapsnapshot_class_nodescan then be used to list the object ids added and deleted for a specific class.