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

✨ Discard loading time when page is hidden #2965

Conversation

N-Boutaib
Copy link
Contributor

@N-Boutaib N-Boutaib commented Sep 3, 2024

Motivation

When a view created in background, its loading time can be inflated due to the browser pausing the javascript execution, which leads to data inconsistencies. It's better to not send the loading time of those views, rather than sending an erroneous value.

Changes

If the page is initially hidden, discard attaching loading_time to view event

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.46%. Comparing base (3f4fd48) to head (3d22ba1).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2965   +/-   ##
=======================================
  Coverage   93.46%   93.46%           
=======================================
  Files         271      271           
  Lines        7630     7636    +6     
  Branches     1699     1700    +1     
=======================================
+ Hits         7131     7137    +6     
  Misses        499      499           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cit-pr-commenter bot commented Sep 3, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 160.70 KiB 160.77 KiB 71 B +0.04%
Logs 55.98 KiB 55.98 KiB 0 B 0.00%
Rum Slim 109.31 KiB 109.38 KiB 71 B +0.06%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 -0.000
addaction 0.034 0.031 -0.004
addtiming 0.001 0.001 -0.000
adderror 0.033 0.032 -0.001
startstopsessionreplayrecording 0.910 0.832 -0.077
startview 1.061 0.934 -0.127
logmessage 0.022 0.020 -0.002
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 7.71 KiB 8.14 KiB 436 B
addaction 39.37 KiB 39.77 KiB 402 B
addtiming 7.04 KiB 6.66 KiB -392 B
adderror 45.46 KiB 43.98 KiB -1519 B
startstopsessionreplayrecording 5.13 KiB 4.55 KiB -593 B
startview 317.75 KiB 349.50 KiB 31.75 KiB
logmessage 40.34 KiB 40.23 KiB -116 B

🔗 RealWorld

@N-Boutaib N-Boutaib changed the title Discard loading time when page is hidden ✨ Discard loading time when page is hidden Sep 3, 2024
@N-Boutaib N-Boutaib marked this pull request as ready for review September 3, 2024 12:10
@N-Boutaib N-Boutaib requested a review from a team as a code owner September 3, 2024 12:10
@N-Boutaib N-Boutaib merged commit fe822e0 into main Sep 5, 2024
20 checks passed
@N-Boutaib N-Boutaib deleted the najib.boutaib/RUM-5179-discard-loading-time-when-page-is-hidden branch September 5, 2024 09:26
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.

4 participants