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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃攰 add view document_count in non-view events #1892

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Dec 20, 2022

Motivation

Help investigate why view event counts are often incorrect.

Changes

Add _dd.view.document_count reflecting the current view document count at the moment when the event is collected. In theory, the final _dd.document_count on View events will alway be greater than child events _dd.view.document_count, because any child event collected will trigger a scheduled view update. Let's verify that.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

This will help investigate why view event counts are often incorrect.
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review December 20, 2022 16:11
@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners December 20, 2022 16:11
It turns out that the View `_dd.document_version` is replaced by another
unrelated version in the backend. I wanted to duplicate this field so we
can keep the original in views.

Because unknown `_dd` fields are discarded from View events by the
backend, I chose to put it in the global context, similarly to #1757
(and other before).
@codecov-commenter
Copy link

Codecov Report

Merging #1892 (1a61e0b) into main (a451519) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1892      +/-   ##
==========================================
- Coverage   93.21%   93.20%   -0.02%     
==========================================
  Files         138      138              
  Lines        5250     5256       +6     
  Branches     1182     1184       +2     
==========================================
+ Hits         4894     4899       +5     
- Misses        356      357       +1     
Impacted Files Coverage 螖
.../src/domain/rumEventsCollection/view/trackViews.ts 100.00% <酶> (酶)
packages/rum-core/src/domain/assembly.ts 100.00% <100.00%> (酶)
...kages/rum-core/src/domain/contexts/viewContexts.ts 100.00% <100.00%> (酶)
packages/core/src/tools/timeUtils.ts 97.43% <0.00%> (-2.57%) 猬囷笍

馃摚 We鈥檙e building smart automated test selection to slash your CI/CD build times. Learn more

@BenoitZugmeyer BenoitZugmeyer merged commit 1dcc3a9 into main Jan 3, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/event-counters--add-view-document-count-on-child-events branch January 3, 2023 12:54
BenoitZugmeyer added a commit that referenced this pull request Jan 19, 2023
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.

None yet

3 participants