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

report(flow): category tooltip highest impact #13230

Merged
merged 14 commits into from
Oct 26, 2021
Merged

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Oct 18, 2021

Hopefully we can agree on an algo for "highest impact" since it's just ranking audits in a single category.

Thought about excluding metrics, but I think it makes sense to list the highest impact metrics under the performance category.

image

#11313

@adamraine adamraine requested a review from a team as a code owner October 18, 2021 22:55
@adamraine adamraine requested review from connorjclark and removed request for a team October 18, 2021 22:55
@google-cla google-cla bot added the cla: yes label Oct 18, 2021
.filter(isRelevantAudit)
.sort((a, b) => {
if (a.weight === b.weight) return b.result.score - a.result.score;
return b.weight * (1 - b.result.score) - a.weight * (1 - a.result.score);
Copy link
Collaborator

Choose a reason for hiding this comment

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

in #13053, we are considering sorting audits by just weight. here, it's:

  1. first by some sort of weighted-weight-by-score thing
  2. then by score

I don't understand 1), could you explain a bit? What's the benefit over just sorting by weight?

Related: perhaps we could sort by overallSavingsMs when the two items are opportunities?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand 1), could you explain a bit? What's the benefit over just sorting by weight?

If we just sort by weight, TBT would always be listed at the top of the performance category unless it's >= 0.9 score. If we have a TBT with score 0.89 and a LCP with a score of 0.0, I think the LCP should be listed first.

Related: perhaps we could sort by overallSavingsMs when the two items are opportunities?

Sorting by savings when weight is 0 SGTM

Copy link
Collaborator

Choose a reason for hiding this comment

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

me and @adamraine discussed:

For perf category, let's add a new section to the tooltip "metrics" showing summary of all metrics. And for the highest impact, for the perf category we only consider opportunities with >0 overallSavingMs

Copy link
Member Author

Choose a reason for hiding this comment

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

We can probably land this PR for v9 without metrics in the tooltip. I'll run the metrics section by Jiwoong and we can work on that after CDS.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK- can you add that to a new issue / tracking issue?

flow-report/src/summary/category.tsx Show resolved Hide resolved
const remainingScoreA = getScoreToBeGained(a);
const remainingScoreB = getScoreToBeGained(b);
if (remainingScoreA !== remainingScoreB) return remainingScoreB - remainingScoreA;
return getOverallSavings(b) - getOverallSavings(a);
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably rare for the tiebreaker to be used for opp audits, fwiw. this current code will sort opportunities by overalSavingsMs albeit indirectly.

related score calculation:

Copy link
Member Author

Choose a reason for hiding this comment

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

remainingScoreX will always be 0 for opportunities because weight is 0.

Are you saying the tiebreaker could be score instead of overallSavingsMs?

Copy link
Collaborator

@connorjclark connorjclark Oct 25, 2021

Choose a reason for hiding this comment

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

remainingScoreX will always be 0 for opportunities because weight is 0.

Right! I forgot.

So this works, it's just a bit to think about, maybe a comment saying that L80 is always zero for perf category (since we only consider opportunity audits and they are all weight 0)?

@adamraine adamraine merged commit d22d73f into master Oct 26, 2021
@adamraine adamraine deleted the flow-tooltip-audits branch October 26, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants