[Reporting][skip ci] Improve performance of Multi-URL jobs#45483
[Reporting][skip ci] Improve performance of Multi-URL jobs#45483tsullivan wants to merge 10 commits intoelastic:masterfrom
Conversation
b66efc2 to
3d2d55b
Compare
There was a problem hiding this comment.
If I understand correctly, this is what closes the stream on the observable, triggering the browser exit logic, and it happens in between each URL
There was a problem hiding this comment.
Yeah, that's how I read it as well
There was a problem hiding this comment.
This stuck out, because it means that there is input validation happening at execute time
There was a problem hiding this comment.
3d2d55b to
1cb463d
Compare
💔 Build Failed |
There was a problem hiding this comment.
positionElements depends on the "type" of Layout instance this is, which means the Layout class is insufficient: its instances are not polymorphic
💔 Build Failed |
4c9bf71 to
4dcd471
Compare
| browser.waitForSelector(successSelectors, {}, logger), // finds DOM attributes for Kibana embeddables | ||
| checkForToastMessage(browser, layout, logger), // if this wins the race, there's an error on the page | ||
| ]); | ||
|
|
There was a problem hiding this comment.
This is much more readable, and less complex, than doing the mergemap chain
There was a problem hiding this comment.
it also seems to not work nearly as well :(
|
This might not be in good enough shape to be the start of something usable. The screenshots/index.ts piece is exciting, but in testing it doesn't work as well as the previous code. I'm going to leave this open as a reference to what we could be doing in the |
|
I'm going to close this Draft PR, because I think the original idea is going to be a less than ideal solution. The problem we're facing is that multi-URL PDFs are generated by creating a new browser driver observable for each URL. Instead of creating the browser driver first and calling screenshotObservable in a loop, it feels like a better change would be just to make the screenshot observable function take an array of strings as URLs. The reason for this thinking is seeing how the current code makes it easy for outside consumers to import the screenshot observable and start making their own screenshots. In a change like the one from this draft PR, the outside consumer would also have to grab the various libraries needed to instantiate the browser driver, and then pass it to the screenshots observable. |
Summary
Closes: #41299
There are a few pre-existing hacks with screenshot generation, so we have to make sure that fixes like this are still going to work: https://github.com/elastic/kibana/pull/31949/files
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers