-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix several bugs in CSI collection #1734
Conversation
this.tick('pc', undefined, userPerceivedVisualCompletenesssTime); | ||
const userPerceivedVisualCompletenesssTime = docVisibleTime > -1 | ||
? (timer.now() - docVisibleTime) | ||
: 1 /* MS (magic number for prerender was complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
csi doesnt like 0
im guessing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nvm, i get it (we already use 0 in tickDelta) and we use 1 as the relative time to it. (for no user perceived delay)
@cramforce LGTM besides the 1 question of about lazy init of promise for |
- miunderstanding of API: To tick absolute deltas one needs to use the relative tick feature with an awkward call pattern. Added `tickDelta` method to make that less weird. - the pc-tick never fired if the layout promises had already started by the time we started measuring 1st viewport performance. Instead added a simpler `loaded` promise to each resource that can always be subscribed to.
@@ -1348,6 +1348,9 @@ export class Resource { | |||
/** @private {boolean} */ | |||
this.isInViewport_ = false; | |||
|
|||
/** @private {?Promise<undefined>} */ | |||
this.layoutPromise_ = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing.
LGTM from me. |
Fix several bugs in CSI collection
@cramforce guessing you want this released into prod asap? |
tickDelta
method to make that less weird.loaded
promise to each resource that can always be subscribed to.