-
Notifications
You must be signed in to change notification settings - Fork 130
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
✨[RUMF-373] Add View load duration and load type #388
✨[RUMF-373] Add View load duration and load type #388
Conversation
…quentin/SDKviewAddLoadDurationAndLoadType
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.
This looks nice!
I think that we could make things simpler and easier to understand by moving some parts around:
-
userActionCollection
should expose acancelCurrentUserAction
function thatviewCollection
could call to cancel a potential user action -
a new utility module could be created to track page activities, and move some of the useraction code into it. It could expose a function like
waitPageIdle(callback: (endTime: number | undefined) => void): { stop(): void }
, that would be used by bothuserActionCollection
andviewCollection
.
By doing this, we shouldn't need a new lifecycle event (VIEW_LOAD_COMPLETED
). The viewCollection
logic would not use functions named waitUserActionCompletion
(this is unintuitive: I understand that loadDuration follows the same logic than useraction, but it should not be based on it).
We can talk about this if it's unclear!
…geActivity function
Codecov Report
@@ Coverage Diff @@
## master #388 +/- ##
=======================================
Coverage 86.95% 86.95%
=======================================
Files 31 31
Lines 1733 1733
Branches 348 348
=======================================
Hits 1507 1507
Misses 226 226 Continue to review full report at Codecov.
|
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.
OK for me, I have two last small comments, but it looks fine otherwise!
What it does
Implement a load duration for each collected View.
This duration starts at the View start time and end when there is no loading activity for a given time.
As the view load occurs before any possible user actions, the collection of user action starts right after.
In addition, a view loading type is collected in view to identify
initial page load
androute change
as any new view is loaded.Context
View load and User actions need to have separated lifecycle. The view loading mode needs to be identify.
Change