Skip to content

Commit ab9055b

Browse files
authored
Merge pull request #583 from MDA2AV/site-infra-comp
fix infrastructure types not showing in composite table
2 parents db733a2 + 452c2cf commit ab9055b

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

site/layouts/shortcodes/leaderboard-composite.html

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,16 @@
741741
Object.keys(allFw).forEach(function(fw) {
742742
if (isExcluded(fw)) return;
743743
var scores = [];
744-
var participated = 0;
744+
// Visibility is separate from scoring: a row shows up whenever the
745+
// framework has *any* data in the active profile set (hasAnyData),
746+
// while the composite total sums only profiles that are scored for
747+
// that framework's type (scoredCount / composite). Conflating the
748+
// two was hiding infrastructure frameworks on every non-H/1.1-isolated
749+
// tab because profileInfraScored is only true for baseline/pipelined/
750+
// limited-conn/static — nginx/h2o then showed 0 scored profiles on
751+
// an H/2 or H/3 tab and were dropped entirely.
752+
var hasAnyData = false;
753+
var scoredCount = 0;
745754
activeIds.forEach(function(pid) {
746755
if (avgByProfile[pid] && avgByProfile[pid][fw] && maxRpsByProfile[pid] > 0) {
747756
var rps = avgByProfile[pid][fw];
@@ -770,22 +779,18 @@
770779
}
771780
}
772781
scores.push(profileScore);
773-
if (isScoredForFw(pid, fw)) participated++;
782+
hasAnyData = true;
783+
if (isScoredForFw(pid, fw)) scoredCount++;
774784
} else {
775785
scores.push(0);
776786
}
777787
});
778-
var composite;
779-
if (participated === 0) {
780-
return;
781-
} else {
782-
var sum = 0;
783-
activeIds.forEach(function(pid, i) {
784-
if (isScoredForFw(pid, fw) && scores[i] > 0) sum += scores[i];
785-
});
786-
composite = sum;
787-
}
788-
results.push({ framework: fw, language: fwLang[fw] || '', scores: scores, composite: composite, participated: participated });
788+
if (!hasAnyData) return;
789+
var sum = 0;
790+
activeIds.forEach(function(pid, i) {
791+
if (isScoredForFw(pid, fw) && scores[i] > 0) sum += scores[i];
792+
});
793+
results.push({ framework: fw, language: fwLang[fw] || '', scores: scores, composite: sum, participated: scoredCount });
789794
});
790795
// Sort by active column
791796
if (compositeSortCol === 'composite' || compositeSortCol === null) {

0 commit comments

Comments
 (0)