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

feat(webvitals): Updates performance score values to use 0-1 cdf values instead of the actual raw component score #2734

Conversation

edwardgou-sentry
Copy link
Contributor

Updates web vital performance score component values to use 0 - 1 cdf values instead of the actual raw component score. The raw component scores have dynamic upper bounds depending on the component weights provided, so we should use the cdf values since they're bound between 0 - 1 (which we can combine with the weight to get the actual score in the product).

@edwardgou-sentry edwardgou-sentry requested review from k-fish and a team November 20, 2023 16:02
@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review November 20, 2023 16:02
@edwardgou-sentry edwardgou-sentry requested a review from a team November 20, 2023 16:02
@@ -915,7 +916,7 @@ fn normalize_performance_score(
measurements.insert(
"score.total".to_owned(),
Measurement {
value: score_total.into(),
value: (score_total / weight_total).into(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Not actionable for this PR, but to not forget about if/how we can remove the score.total measurement.

@edwardgou-sentry edwardgou-sentry merged commit fc0a6ec into master Nov 21, 2023
@edwardgou-sentry edwardgou-sentry deleted the egou/feat/store-cdf-instead-of-score-for-performance-score-calculation branch November 21, 2023 15:39
@k-fish
Copy link
Member

k-fish commented Nov 23, 2023

If you're planning on doing avg CDF * avg weight for a component (eg. FCP) then I would triple check that the total score and each component score adds up every which way. It's a different calculation because each individual CDF has a difference on the sum of weighted CDF depending on that weight for that particular profile.

I wrote storing weights / weighted scores as a one liner on the original doc, but it was almost a footnote, it really deserves it's own section, I added a Example Score Calculations section to walk through the calculations.

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.

4 participants