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

Add LUX.lateUserTiming #33

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

josephwynn-sc
Copy link
Member

This is an experimental feature that would allow lux.js to measure user timing events that occur after the main beacon has been sent.

How it works

Users of lux.js provide an "allow list" of user timing events that can be sent after the main beacon.

LUX.lateUserTiming = [
  "my-late-mark", // Specify exact mark/measure names
  /^allowed-.+/, // Specify regular expressions to match against mark/measure names
];

Possible enhancements

Right now there is a hard-coded 100 ms wait time before sending a supplementary user timing beacon. This is to ensure user timing events that occur in quick succession are batched into a single beacon request. I don't have any data to back this up but I suspect 100 ms would not be long enough to prevent multiple beacons from being sent. We could expose this wait time as a configurable value.

Alternative solutions

Send late user timing before unload

Another solution would be to have a boolean LUX.lateUserTiming = true configuration option that enabled all late user timing events to be sent before the page unload event. This would require very little effort from lux.js users, and could even be enabled via the SpeedCurve UI. The biggest drawback is that there are potentially hundreds or thousands of user timing events that occur before the unload event - probably from third parties. This could result in a massive beacon payload, and put extra strain on our beacon pipeline.

A variation of this solution is to keep the "allow list" approach but send the supplementary user timing beacon before unload rather than after a 100 ms timer.

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.

1 participant