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-342] use startTime for events timestamp #275

Merged
merged 5 commits into from
Feb 19, 2020
Merged

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Feb 19, 2020

Use startTime instead of collection time in order to have a more accurate date for events.

@bcaudan bcaudan requested a review from a team as a code owner February 19, 2020 12:53
@bcaudan bcaudan changed the title ✨ use startTime for events timestamp ✨[RUMF-342] use startTime for events timestamp Feb 19, 2020
@@ -55,8 +55,7 @@ function newView(location: Location, session: RumSession, upsertRumEvent: (event
location: { ...location },
sessionId: session.getId(),
}
startTimestamp = new Date().getTime()
startOrigin = performance.now()
startOrigin = isInitialView ? 0 : performance.now()
Copy link
Member

Choose a reason for hiding this comment

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

NIT: you could check if the viewContext object was defined instead of having another mutable state.

errorObservable.notify({ message: '1', ...CONTEXT })
errorObservable.notify({ message: '2', ...CONTEXT })
errorObservable.notify({ message: '3', ...CONTEXT })
errorObservable.notify({ message: '1', startTime: 100, ...CONTEXT })
Copy link
Member

Choose a reason for hiding this comment

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

NIT: startTime: 100 could be in CONTEXT

@bcaudan bcaudan merged commit ab10d25 into master Feb 19, 2020
@bcaudan bcaudan deleted the bcaudan/event-start branch February 19, 2020 15:56
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.

2 participants