Skip to content

ref: Restore node 6 support due to yarn engine checks, add performance.now fallback - #2460

Merged
kamilogorek merged 1 commit into
masterfrom
perf-fallback
Feb 28, 2020
Merged

kamilogorek merged 1 commit into
masterfrom
perf-fallback

Conversation

@kamilogorek

Copy link
Copy Markdown
Contributor

@kamilogorek
kamilogorek requested a review from HazAT February 28, 2020 15:39
@getsentry-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️ Please add a changelog entry for your changes.
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 16.6973 kB) (ES6: 15.7109 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against d268f5f

@kamilogorek
kamilogorek merged commit 5b78cbc into master Feb 28, 2020
@kamilogorek
kamilogorek deleted the perf-fallback branch February 28, 2020 15:45
@Turbo87

Turbo87 commented Feb 28, 2020

Copy link
Copy Markdown
Contributor

awesome, thanks @kamilogorek :)

Comment thread packages/apm/src/span.ts

const performanceFallback: Pick<Performance, 'now'> = {
now(): number {
return INITIAL_TIME - Date.now();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think storing the initial time is unnecessary.
The point of using performance.now is to compute durations t1-t0; it doesn't matter to subtract yet INITIAL_TIME. And as a fallback it is limited anyway, since it is has no guarantee on being monotonic, unlike the real performance.now.

@kamilogorek kamilogorek Feb 29, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

performance.now returns a delta from start till now. We need a fallback to do the same, in behavior sense.

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.

5 participants