-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Runtime.getHeapUsage for hermes chrome inspector #32895
Conversation
9a75543
to
45814bf
Compare
Base commit: 6b42bcc |
Base commit: 6b42bcc |
I realized most of the code is generated using tools/run_msggen. I was able to adapt the script to make it usable outside fb, except for the I also added support for including experimental commands to msggen since Updating the chrome devtools npm package caused some changes to the schema so there are a few unrelated new properties. |
@ShikaSD has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @janicduplessis in 3568a72. When will my fix make it into a release? | Upcoming Releases |
Hey, @janicduplessis, seems like update of the devtools version made the |
This pull request has been reverted by 2bc883e. |
Sadly the command does not exist when using the current devtools protocol version. I checked and it was added after the params object to resume, so there is also no version that exist where it would work. Would it be hard to update the internal tool to pass params? Other option would be to make the codegen check if params exist, but would cause lots of changes to the codegen output. |
It seems like we have quite a few tools that use this codegen as a source of truth, so probably it is better to modify codegen to check for optional param :) |
Actually it might be possible to address with minimal changes by checking if all parameters are optional, then make the whole params object optional. |
Yep https://github.com/ChromeDevTools/devtools-protocol/blob/master/json/js_protocol.json#L641 |
…32895) Summary: I was looking at the hermes chrome devtools integration and noticed requests to `Runtime.getHeapUsage` which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools. <img width="325" alt="image" src="https://user-images.githubusercontent.com/2677334/149637113-e1d95d26-9e26-46c2-9be6-47d22284f15f.png"> ## Changelog [General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector Pull Request resolved: facebook#32895 Test Plan: Before <img width="912" alt="image" src="https://user-images.githubusercontent.com/2677334/149637073-15f4e1fa-8183-42dc-8673-d4371731415c.png"> After <img width="1076" alt="image" src="https://user-images.githubusercontent.com/2677334/149637085-579dee8f-5efb-4658-b0a8-2400bd119924.png"> Reviewed By: christophpurrer Differential Revision: D33616658 Pulled By: ShikaSD fbshipit-source-id: 49d863e6a58d4a92d4c86f9a288ac33ed8d2cb0d
Summary: Reland of #32895 with fix for optional params object. Original description: I was looking at the hermes chrome devtools integration and noticed requests to `Runtime.getHeapUsage` which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools. <img width="325" alt="image" src="https://user-images.githubusercontent.com/2677334/149637113-e1d95d26-9e26-46c2-9be6-47d22284f15f.png"> ## Changelog [General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector Pull Request resolved: #33173 Test Plan: I was able to reproduce the issue that caused the initial PR to be reverted using the resume request in Flipper. Pausing JS execution then resuming it will cause it to crash before this change, and works fine after. Before <img width="912" alt="image" src="https://user-images.githubusercontent.com/2677334/149637073-15f4e1fa-8183-42dc-8673-d4371731415c.png"> After <img width="1076" alt="image" src="https://user-images.githubusercontent.com/2677334/149637085-579dee8f-5efb-4658-b0a8-2400bd119924.png"> Reviewed By: jpporto Differential Revision: D34446672 Pulled By: ShikaSD fbshipit-source-id: 6e26b8d53cd88cddded36437c72a01822551b9d0
…33173) Summary: Reland of facebook#32895 with fix for optional params object. Original description: I was looking at the hermes chrome devtools integration and noticed requests to `Runtime.getHeapUsage` which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools. <img width="325" alt="image" src="https://user-images.githubusercontent.com/2677334/149637113-e1d95d26-9e26-46c2-9be6-47d22284f15f.png"> [General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector Pull Request resolved: facebook#33173 Test Plan: I was able to reproduce the issue that caused the initial PR to be reverted using the resume request in Flipper. Pausing JS execution then resuming it will cause it to crash before this change, and works fine after. Before <img width="912" alt="image" src="https://user-images.githubusercontent.com/2677334/149637073-15f4e1fa-8183-42dc-8673-d4371731415c.png"> After <img width="1076" alt="image" src="https://user-images.githubusercontent.com/2677334/149637085-579dee8f-5efb-4658-b0a8-2400bd119924.png"> Reviewed By: jpporto Differential Revision: D34446672 Pulled By: ShikaSD fbshipit-source-id: 6e26b8d53cd88cddded36437c72a01822551b9d0
…32895) Summary: I was looking at the hermes chrome devtools integration and noticed requests to `Runtime.getHeapUsage` which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools. <img width="325" alt="image" src="https://user-images.githubusercontent.com/2677334/149637113-e1d95d26-9e26-46c2-9be6-47d22284f15f.png"> ## Changelog [General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector Pull Request resolved: facebook#32895 Test Plan: Before <img width="912" alt="image" src="https://user-images.githubusercontent.com/2677334/149637073-15f4e1fa-8183-42dc-8673-d4371731415c.png"> After <img width="1076" alt="image" src="https://user-images.githubusercontent.com/2677334/149637085-579dee8f-5efb-4658-b0a8-2400bd119924.png"> Reviewed By: christophpurrer Differential Revision: D33616658 Pulled By: ShikaSD fbshipit-source-id: 49d863e6a58d4a92d4c86f9a288ac33ed8d2cb0d
Summary
I was looking at the hermes chrome devtools integration and noticed requests to
Runtime.getHeapUsage
which was not implemented. When implemented it will show a summary of memory usage of the javascript instance in devtools.Changelog
[General] [Added] - Implement Runtime.getHeapUsage for hermes chrome inspector
Test Plan
Before
After