diagnostics_channel: add iterator support to tracing channel#61686
Open
rochdev wants to merge 4 commits intonodejs:mainfrom
Open
diagnostics_channel: add iterator support to tracing channel#61686rochdev wants to merge 4 commits intonodejs:mainfrom
rochdev wants to merge 4 commits intonodejs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61686 +/- ##
==========================================
- Coverage 89.75% 89.65% -0.10%
==========================================
Files 674 676 +2
Lines 204394 206626 +2232
Branches 39278 39560 +282
==========================================
+ Hits 183448 185248 +1800
- Misses 13238 13492 +254
- Partials 7708 7886 +178
🚀 New features to boost your workflow:
|
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.
Most tracing channel use cases can already be handled by a combination of
traceSync,tracePromiseandtraceCallback. However, functions returning an iterator need the iterator to also be instrumented. This is because for the operation executed by the function to actually be done the iterator needs to reach its done state, and to collect the result the chunks from each iteration must be available.This PR adds support for a new
traceIteratorfunction that wraps a function returning an iterator so that both the function and every iterator iterations are traced.Open question:
traceIteratorjust wrap iterators and not functions? This would deviate from othertraceXmethods but would remove the need to handle sync and async with the same function.tracePromisealso handle synchronous return values similar to the new#traceMaybePromise? Right now it converts to a promise, which may incorrectly change the return type.