-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
API to stream things happening on Event Loop #47590
Comments
No, that's only when you use the command line flags. You can access the inspector programmatically through |
Ok let me look at Tried with debugger api to pause the execution and then resume by collection stack frames "Fails at conceptual level" cause once you pause you pause your own code which cannot resume your debugger, so This option doesn't work, The native runtime has to support this, and keep publishing the stack-frames on stdout that is the exact ask |
The underlying issue is that capturing a stack is expensive as is opening the inspector |
There should be some way, cause eventloop does have list of things to do next, it should be able to do dump that (it can be obfuscated, assuming later we merge this dump with some pdb kind of files which can reveal the stack in normal english) again i am not an expert but if we get this done think of how use it can be, run everything as is on prod just capture the logs while issue occurs.. |
Sounds like async_hooks is what you're looking for. Yes, it's experimental. Doesn't mean it's buggy or unusable. |
Aren't they being deprecated/removed? |
Are you referring to #46265? The ETA of that is probably better measured in years than months. |
If there are valid usecase for async hooks which can't be replaced by something like |
In light of @Flarna's comment I'll go ahead and close this. LMK if there's reason to reopen. |
What is the problem this feature will solve?
There are lot of developers who put in
console.log
just to understand stack trace of the execution. This is a usability problem with most languages, if there was an way in which we could push out all stack frames as they happen on the event loop when lets say a "DEBUG" environment variable is set then most of 90% use cases for writingconsole.log
would be met.. and make debugging even prod applications easy as this is a built in feature of the language.What is the feature you are proposing to solve the problem?
The feature should be hidden behind a Environment Flag lets say "Debug" when present event loop can start pushing stack frames of completed calls to
STDOUT
which can be left for the user to capture it.(This informs them about what is executing in the event loop like a peep inside it)This feature can then be extended by passing in execution time & memory allocated or cleared with function name or stack frames thus telling perf issues if any..
What alternatives have you considered?
The text was updated successfully, but these errors were encountered: