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

✨[RUMF-737] migrate resource to v2 format (experimental) #584

Merged
merged 7 commits into from
Oct 23, 2020

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Oct 22, 2020

Motivation

Following #570, migrating resource to v2 format

Changes

  • introduce resource collection
  • move some rum spec to appropriate test files
  • move some code around according to new file organization
  • handle resource in v2

Testing

unit tests, staging


I have gone over the contributing documentation.

@bcaudan bcaudan requested a review from a team as a code owner October 22, 2020 12:21
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer left a comment

Choose a reason for hiding this comment

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

Looks good!

import { LifeCycleEventType } from '../lifeCycle'
import { setup, TestSetupBuilder } from '../../../../test/specHelper'
import { RumPerformanceEntry } from '../../../browser/performanceCollection'
import { RumEventCategory } from '../../../index'
Copy link
Member

Choose a reason for hiding this comment

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

We might want to introduce some TS path to avoid deep relative require paths

Copy link
Contributor Author

@bcaudan bcaudan Oct 23, 2020

Choose a reason for hiding this comment

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

Yes, it could be nice.
Let's see in which state we are at the end of the migration, we'll probably want to re-challenge the file organization.
It could be easier to define the right relative path at this point.

handleRequest(lifeCycle, session, handler, request)
if (session.isTrackedWithResource()) {
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processRequest(request))
lifeCycle.notify(LifeCycleEventType.RESOURCE_ADDED_TO_BATCH)
Copy link
Member

Choose a reason for hiding this comment

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

NIT for another PR: RESOURCE_ADDED_TO_BATCH could probably be replaced with a RAW_RUM_EVENT_COLLECTED usage + test on evt.category

Copy link
Contributor Author

@bcaudan bcaudan Oct 23, 2020

Choose a reason for hiding this comment

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

yep, I've listed some potential cleanup here

@codecov-io
Copy link

Codecov Report

Merging #584 into master will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #584      +/-   ##
==========================================
- Coverage   88.13%   88.07%   -0.06%     
==========================================
  Files          46       47       +1     
  Lines        2359     2382      +23     
  Branches      492      493       +1     
==========================================
+ Hits         2079     2098      +19     
- Misses        280      284       +4     
Impacted Files Coverage Δ
packages/rum/src/browser/performanceCollection.ts 64.28% <ø> (-2.86%) ⬇️
packages/rum/src/domain/lifeCycle.ts 100.00% <ø> (ø)
packages/rum/src/domain/requestCollection.ts 78.37% <ø> (ø)
...rumEventsCollection/longTask/longTaskCollection.ts 100.00% <ø> (ø)
...rumEventsCollection/resource/matchRequestTiming.ts 94.11% <ø> (ø)
...kages/rum/src/domain/tracing/getDocumentTraceId.ts 100.00% <ø> (ø)
packages/rum/src/domain/tracing/tracer.ts 100.00% <ø> (ø)
packages/rum/src/types.ts 100.00% <ø> (ø)
packages/rum/src/typesV2.ts 100.00% <ø> (ø)
packages/rum/src/boot/rum.ts 62.50% <100.00%> (-14.52%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27e48e4...511d6f2. Read the comment docs.

@bcaudan bcaudan merged commit 61ac143 into master Oct 23, 2020
@bcaudan bcaudan deleted the bcaudan/resources branch October 23, 2020 08:33
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