Fix: Continuity high TTI values reported (mostly when c.tti gets leaked to other type of beacon) #311
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.
Hi Team,
Related partially on: #248 #245
What we want
We want
c.tti
to be calculated accurately on the page load beacon (spa_hard or undefined initiators).Cases it fails:
Unpredictable cases:
Predictable cases:
According to our code, the assumption of the value of
c.tti
is:VisuallyReady
<c.tti
< (page_ready
+waitAfterOnLoad
)We try to calculate
c.tti
afterpage_ready
is fired and forwaitAfterOnLoad
ms. After which we send page load beacon withoutc.tti
. (Since our assumption equation didn't work for some users)Now, If
afterOnLoad=true
c.tti
is possible to be attached to any type of beacon, especially when it fails atpage_load
. But then thec.tti
values reported are very high and very unreliable. I know it's anyways not a good idea to trust them. But this PR tries to somewhat rectify that issue.Scenario
c.tti
failed to be calculatedc.tti
Timeline
class in Continuity flushes its data.c.tti
is calculated before every beacon being sent (but never has good enough data (for seeing 500ms CPU idle) because the real data gets flushed whenever a beacon is sent)!data.fps[j]
makes the function feel that the page was busy until the time we last started capturing the data. (which is when the User went to play COD mobile)c.tti
will be reported as the last time we started capturing the data. (and it will be a very large value, because of the time he spent scrolling up and down on the page)Fix
idleIntervals
outside the loop. Because we want to remember the number of intervals it was free before flushing out the data.bucketsVisited
to track buckets we have already visited. So that we don't go through the data again for which we didn't see any improvementsonBeacon
to remove only the data that we have seen. But ifc.tti
was calculated then flush as we use to before.