Skip to content
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

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

cramforce
Copy link
Member

  • 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.

this.tick('pc', undefined, userPerceivedVisualCompletenesssTime);
const userPerceivedVisualCompletenesssTime = docVisibleTime > -1
? (timer.now() - docVisibleTime)
: 1 /* MS (magic number for prerender was complete
Copy link
Member

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?

Copy link
Member

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)

@erwinmombay
Copy link
Member

@cramforce LGTM besides the 1 question of about lazy init of promise for loaded

- 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing.

@dvoytenko
Copy link
Contributor

LGTM from me.

cramforce added a commit that referenced this pull request Feb 2, 2016
Fix several bugs in CSI collection
@cramforce cramforce merged commit 612373f into ampproject:master Feb 2, 2016
@cramforce cramforce deleted the broken-csi branch February 2, 2016 17:57
@erwinmombay
Copy link
Member

@cramforce guessing you want this released into prod asap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants