question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There should be only one target manager

See original GitHub issue

In FR, each NetworkMonitor creates its own target manager. The target manager does things to targets as they attach. It may be bad to do this stuff multiple times when one would suffice.

Instead, we could add to Driver a getTargetManagerForSession(session) method that would return a cached target manager.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brendankennycommented, Jun 7, 2022

a few things that came up today:

  • having a standalone TargetManager is great. The legacy auto attach logic is diffuse and appears general (e.g. we allow sendCommand to arbitrary session ids), but is actually used only for listening to iframe network requests. The new TargetManager is nice in that it admits it only does that one thing and does it mostly in one place, so it makes a bit of sense to be managed by network-monitor.

    But: if we want a single targetManager, it makes sense to invert control and have it as an easily available tool at the driver/connection/defaultSession/wherever level. For instance, I recently wanted to write a gatherer that did a context.evaluate() to inject a performance.measure() into every iframe. That would have to all be manually done in lighthouse right now, even though we autoattach to all targets and check for iframe targetInfos and everything 😃 There’s also no need to be as general as pptr (providing an API to find iframes and get a handle to them), because, again, we’re already auto-attaching to them.

  • networkMonitoring should similarly be persistent while gathering, and it should be easily accessible from anywhere. waitFor and fullPageScreenshot can be clients of that, rather than driving it. Lighthouse is already getting all the CDP events, whether it’s being recorded or not, so there’s no reason you shouldn’t be able to just subscribe to network-critical-idle and be notified at any time, instead of having to fire up a networkMonitor of your own.

0reactions
connorjclarkcommented, Sep 6, 2022

but that’s not a P1 anymore, all P1 stuff done

Read more comments on GitHub >

github_iconTop Results From Across the Web

The On-Time, On-Target Manager: How a "Last-Minute ...
Steve Gottry and Ken Blanchard wrote an amazingly simple book packed with practical ideas backed by spiritual concepts. You could read this book...
Read more >
The-On-Time-On-Target-Manager-Read-Sample0001.pdf
Ken Blanchard and Steve Gottry have knocked it out of the park with The On-Time, On-Target. Manager. This book not only offers a...
Read more >
Book Review: The On-Time On-Target Manager
I decided to purchase The On-time, On-target Manager as a recommendation during a personal development programme called 'Bring-it'.
Read more >
The On-Time, On-Target Manager: How a Last-Minute ...
The author of the phenomenal New York Times bestselling classic The One-Minute® Manager explores one of the most common and.
Read more >
Target Corporation Code of Ethics
Consider it an essential resource for making ethical choices – ... the items will only be in the aisle a short ... Vendor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found