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): refine snapshot and timespan performance #13184

Merged
merged 12 commits into from
Oct 8, 2021

Conversation

adamraine
Copy link
Member

A few changes here:

  • Don't show the metrics category if there are no metrics. Applies to snapshot reports.
  • Ignore manual audits and audits with no groups when calculating the category fraction. There were some metrics not in any group that snuck there way into the timespan performance category fraction
  • Ignore informative audits in the category fraction, but track them separately and display in tooltip. I thought this might be useful information but it's not 100% necessary.

#11313

@adamraine adamraine requested a review from a team as a code owner October 6, 2021 23:12
@adamraine adamraine requested review from patrickhulce and removed request for a team October 6, 2021 23:12
@google-cla google-cla bot added the cla: yes label Oct 6, 2021
flow-report/src/summary/category.tsx Show resolved Hide resolved
@@ -172,33 +172,35 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
}

// Metrics.
const metricAuditsEl = this.renderAuditGroup(groups.metrics);
const metricAudits = category.auditRefs.filter(audit => audit.group === 'metrics');
if (metricAudits.length) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

oof, really reveals the length of this function 😬

report/renderer/util.js Outdated Show resolved Hide resolved
const auditPassed = Util.showAsPassed(auditRef.result);

// Don't count the audit if it's manual or isn't displayed.
if (!auditRef.group || auditRef.result.scoreDisplayMode === 'manual') {
Copy link
Member

Choose a reason for hiding this comment

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

FWIW I'm pretty sure we only enforce no group === not displayed in performance-category-renderer. It looks like it's the de facto rule now, but only because every non-manual, non-perf audit appears to have a group assigned in the default config since #10623

Copy link
Member Author

Choose a reason for hiding this comment

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

To be safe I added a category.id === 'performance' condition

@adamraine
Copy link
Member Author

So informative audits marked N/A will not be completely ignored when calculating the audit fraction because they will no longer have scoreDisplayMode: 'informative'. This means that the total passable audits will change depending on how many informative audits are N/A.

I think this change is still worthwhile, since the number of "failing" audits is still accurately represented. Maybe we could track N/A audits separately as well?

@patrickhulce
Copy link
Collaborator

This means that the total passable audits will change depending on how many informative audits are N/A.

Seems like N/A shouldn't be treated as passable and be skipped in the passed calculation then?

@adamraine
Copy link
Member Author

Seems like N/A shouldn't be treated as passable and be skipped in the passed calculation then?

Ya that's what I'm thinking. I don't think a # n/a audits in the tooltip will be necessary though.

@@ -297,7 +297,7 @@ describe('CategoryRenderer', () => {
);

const gauge = categoryDOM.querySelector('.lh-fraction__content');
assert.equal(gauge.textContent.trim(), '39/44', 'fraction is included');
Copy link
Member Author

Choose a reason for hiding this comment

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

Accessibility does have a lot of N/A audits in this sample. I don't think it's a huge deal.

@adamraine adamraine merged commit ac497fa into master Oct 8, 2021
@adamraine adamraine deleted the flow-refine-performance branch October 8, 2021 16:31
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.

4 participants