Skip to content

Commit fb2f166

Browse files
committed
fix NaN% and broken compare #1749
1 parent 076e125 commit fb2f166

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

webdriver-ts-results/src/Common.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function colorsForStatisticResult(statisticResult: StatisticResult) {
180180
}
181181

182182
const statisticComputeColor = function (sign: number, pValue: number): [string, string, StatisticResult] {
183-
if (pValue > 0.05) {
183+
if (pValue > 0.05 || Number.isNaN(pValue)) {
184184
return undecided; //['#fff','#000', StatisticResult.Undecided];
185185
}
186186
if (sign <= 0) {
@@ -460,17 +460,18 @@ export class ResultTableData {
460460
// if (benchmark.type === BenchmarkType.CPU) {
461461
// factor = Math.max(1, factor);
462462
// }
463-
const conficenceInterval =
463+
const confidenceInterval =
464464
(1.959964 * (resultValues.standardDeviation || 0)) / Math.sqrt(resultValues.values.length);
465-
const conficenceIntervalStr = benchmark.type === BenchmarkType.CPU ? conficenceInterval.toFixed(1) : null;
466-
const formattedValue = formatEn.format(value);
465+
const confidenceIntervalStr = benchmark.type === BenchmarkType.CPU ? confidenceInterval.toFixed(1) : null;
466+
const formattedValue = formatEn.format(value);
467+
console.log("confidenceInterval", benchmark.id, framework.name, formattedValue, value, confidenceInterval, confidenceIntervalStr, resultValues.values.length)
467468

468-
if (!this.compareWith) {
469+
if (!this.compareWith || benchmark.type !== BenchmarkType.CPU) {
469470
return new TableResultValueEntry(
470471
framework.name,
471472
value,
472473
formattedValue,
473-
conficenceIntervalStr,
474+
confidenceIntervalStr,
474475
factor,
475476
factor.toFixed(2),
476477
computeColor(factor),
@@ -511,7 +512,7 @@ export class ResultTableData {
511512
framework.name,
512513
value,
513514
formattedValue,
514-
conficenceIntervalStr,
515+
confidenceIntervalStr,
515516
factor,
516517
factor.toFixed(2),
517518
statisticalCol[0],

0 commit comments

Comments
 (0)