Reduce overhead of monitor pipeline#5
Merged
watson merged 3 commits intoelastic:masterfrom Dec 2, 2020
Merged
Conversation
3 tasks
spalger
approved these changes
Nov 30, 2020
| const stream = streams[0]; | ||
|
|
||
| if (streams.length === 1) { | ||
| finished(stream, onFinished); |
There was a problem hiding this comment.
Nice, didn't know about the finished() helper!
There was a problem hiding this comment.
OMG, finally it's provided out-of-the-box
mshustov
approved these changes
Dec 1, 2020
mshustov
left a comment
There was a problem hiding this comment.
Considering that @hapi/good is EOL on 31.12.2020, I'm okay with this divergence from the upstream. I created elastic/kibana#82240 to remove the dependency on @hapi/good package.
Author
|
@spalger my latest commit only fixed part of the CI issue. There's still some failures. However, it looks like |
Author
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 PR optimizes two things:
Use
pipelineoverpumpifyThis is mainly to fix an "issue" with Node.js 14 where
pumpifyrequires a few extra ticks every time someone writes to the pipeline. This could result in the process crashing prior to the logger writing to its destination. For example, in the following example, thedataevent-listener would never be called before the process crashes because of the thrown error on Node.js 14:However, the following would call the
dataevent-listener on Node.js 14:Don't use pipeline if not required
In the case where there's only one stream, there's no need to use a pipeline. Instead we can just write directly to the stream. This also reduces the overhead of the logger slightly.