Skip to content

Commit 4edc680

Browse files
committed
Render empty results at the end of the table for easier local benchmarking. Fixes #1577
1 parent afe45af commit 4edc680

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webdriver-ts-results/src/Common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,15 @@ export class ResultTableData {
364364
benchmarkWeights = Array.from<number>({ length: benchmarks.length }).fill(1);
365365
}
366366

367+
let hasResults = false;
367368
let gMean = 0.0;
368369
resultsForFramework.forEach((r, idx) => {
369370
if (r !== null && !Number.isNaN(r.factor)) {
371+
hasResults = true;
370372
gMean += benchmarkWeights[idx] * Math.log(r.factor);
371373
}
372374
});
373-
const value = Math.exp(gMean / benchmarkWeights.reduce((a, b) => a + b, 0));
375+
const value = hasResults ? Math.exp(gMean / benchmarkWeights.reduce((a, b) => a + b, 0)) : NaN;
374376

375377
return this.compareWith
376378
? new TableResultGeommeanEntry(framework.name, framework, value, "#fff", "#000")

0 commit comments

Comments
 (0)