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: sort performance audits based on impact #15445

Merged
merged 39 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
129319d
get overall impact for all audits
adrianaixba Aug 11, 2023
b6abb30
Merge branch 'main' into metric-savings-score
adrianaixba Aug 11, 2023
7881ecd
calculate overall impact
adrianaixba Aug 11, 2023
317f85c
Merge branch 'main' into metric-savings-score
adamraine Aug 16, 2023
2a7ef45
linear impact + old scoring fallback
adamraine Aug 16, 2023
4f7b7f4
rm color indicators
adrianaixba Aug 16, 2023
3adb1e1
Merge branch 'main' into metric-savings-score
adrianaixba Aug 31, 2023
e1ebbb8
add simple guidance level sort
adrianaixba Aug 31, 2023
6a642ad
add gl to impact, rm dependency on score
adrianaixba Aug 31, 2023
9838c9c
fall back to old sort
adamraine Sep 1, 2023
be2455b
remove guidance level from main sort
adrianaixba Sep 6, 2023
212be08
add metrics filter back
adrianaixba Sep 8, 2023
5f0f5f7
sample json
adrianaixba Sep 8, 2023
629f841
Merge branch 'main' into metric-savings-score
adrianaixba Sep 20, 2023
74d1cb9
fix
adrianaixba Sep 20, 2023
be716af
update proto
adrianaixba Sep 21, 2023
c2521ad
add tests
adrianaixba Sep 21, 2023
8b1fd65
nit
adrianaixba Sep 22, 2023
9ed4c98
Merge branch 'main' into metric-savings-score
adrianaixba Sep 22, 2023
c1d75f8
nit
adrianaixba Sep 22, 2023
b658d37
nit
adrianaixba Sep 22, 2023
6a56412
fix perf render tests
adrianaixba Sep 26, 2023
3e2af6c
move statistics
adrianaixba Sep 26, 2023
1b06077
Merge branch 'main' into metric-savings-score
adrianaixba Sep 26, 2023
d49ee44
test fixie
adrianaixba Sep 26, 2023
ae40a9b
fixes
adrianaixba Sep 26, 2023
3266cf3
nit fixie
adrianaixba Sep 26, 2023
ce877bd
cleanups
adrianaixba Sep 26, 2023
b2b98e2
nit
adrianaixba Sep 26, 2023
c2600ef
nit
adrianaixba Sep 26, 2023
2352042
nit
adrianaixba Sep 26, 2023
4d2e45b
nitsss
adrianaixba Sep 26, 2023
17f4fef
add comments
adrianaixba Sep 27, 2023
68f0793
avoid recalculating impact details
adrianaixba Oct 2, 2023
b7e3930
Merge branch 'main' into metric-savings-score
adrianaixba Oct 2, 2023
91892d7
nits
adrianaixba Oct 2, 2023
02ebf4b
nit
adrianaixba Oct 2, 2023
7d44fff
Merge branch 'main' into metric-savings-score
adamraine Oct 2, 2023
235f258
nit
adamraine Oct 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions report/renderer/performance-category-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,16 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
const diagnosticAudits = category.auditRefs
.filter(audit => this._isPerformanceInsight(audit))
.filter(audit => !ReportUtils.showAsPassed(audit.result));

/** @type {Array<{auditRef:LH.ReportResult.AuditRef, overallImpact: number, overallLinearImpact: number, guidanceLevel: number}>} */
const auditImpacts = [];
diagnosticAudits.forEach(audit => {
const {
overallImpact: overallImpact,
overallLinearImpact: overallLinearImpact,
} = this.overallImpact(audit, metricAudits);
// eslint-disable-next-line max-len
auditImpacts.push({auditRef: audit, overallImpact, overallLinearImpact, guidanceLevel: audit.result.guidanceLevel || 1});
const guidanceLevel = audit.result.guidanceLevel || 1;
adrianaixba marked this conversation as resolved.
Show resolved Hide resolved
auditImpacts.push({auditRef: audit, overallImpact, overallLinearImpact, guidanceLevel});
});

auditImpacts.sort((a, b) => {
Expand All @@ -245,10 +246,11 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {

if (a.guidanceLevel !== b.guidanceLevel) return b.guidanceLevel - a.guidanceLevel;

// eslint-disable-next-line max-len
const scoreA = a.auditRef.result.scoreDisplayMode === 'informative' ? 100 : Number(a.auditRef.result.score);
// eslint-disable-next-line max-len
const scoreB = b.auditRef.result.scoreDisplayMode === 'informative' ? 100 : Number(b.auditRef.result.score);
const scoreA = a.auditRef.result.scoreDisplayMode === 'informative'
? 100
: Number(a.auditRef.result.score);
const scoreB = b.auditRef.result.scoreDisplayMode === 'informative'
? 100 : Number(b.auditRef.result.score);
return scoreA - scoreB;
});

Expand Down
Loading