Skip to content

Commit faf9a67

Browse files
committed
fix_measure_count
1 parent 1f5c7d7 commit faf9a67

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

services/console/src/chunks/docs-reference/changelog/en/changelog.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Pending `v0.4.31`
2+
- Fix Report measure count bug
3+
14
## `v0.4.30`
25
- Fix Bencher Self-Hosted Console build bug since `v0.4.24`
36

services/console/src/components/console/deck/hand/card/ReportCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ const missingThreshold = (
718718
return new Set(measuresMap.values());
719719
};
720720

721-
const boundaryLimitsMap = (
721+
export const boundaryLimitsMap = (
722722
iteration: JsonReportIteration,
723723
): Map<string, BoundaryLimits> => {
724724
const map = new Map<string, BoundaryLimits>();

services/console/src/components/console/perf/plot/tab/ReportsTab.tsx

+18-27
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
import { type Accessor, For, Show, Switch, Match, createMemo } from "solid-js";
1+
import { type Accessor, For, Match, Show, Switch, createMemo } from "solid-js";
2+
import { ALERT_ICON } from "../../../../../config/project/alerts";
3+
import { BENCHMARK_ICON } from "../../../../../config/project/benchmarks";
4+
import { BRANCH_ICON } from "../../../../../config/project/branches";
5+
import { MEASURE_ICON } from "../../../../../config/project/measures";
6+
import { TESTBED_ICON } from "../../../../../config/project/testbeds";
27
import type { PerfTab } from "../../../../../config/types";
38
import { fmtDateTime, resourcePath } from "../../../../../config/util";
49
import type { JsonReport } from "../../../../../types/bencher";
510
import { BACK_PARAM, encodePath } from "../../../../../util/url";
6-
import { BRANCH_ICON } from "../../../../../config/project/branches";
7-
import { TESTBED_ICON } from "../../../../../config/project/testbeds";
8-
import { BENCHMARK_ICON } from "../../../../../config/project/benchmarks";
9-
import { MEASURE_ICON } from "../../../../../config/project/measures";
10-
import { ALERT_ICON } from "../../../../../config/project/alerts";
11-
import type { TabElement, TabList } from "./PlotTab";
1211
import DateRange from "../../../../field/kinds/DateRange";
13-
import { themeText, type Theme } from "../../../../navbar/theme/theme";
14-
import ReportCard from "../../../deck/hand/card/ReportCard";
12+
import { type Theme, themeText } from "../../../../navbar/theme/theme";
13+
import ReportCard, {
14+
boundaryLimitsMap,
15+
} from "../../../deck/hand/card/ReportCard";
16+
import type { TabElement, TabList } from "./PlotTab";
1517

1618
const ReportsTab = (props: {
1719
project_slug: Accessor<undefined | string>;
@@ -167,7 +169,7 @@ const ReportRow = (props: {
167169
}
168170
const plural =
169171
benchmarkCount.length > 1 ||
170-
benchmarkCount.filter((count) => count > 1).length > 0;
172+
benchmarkCount.some((count) => count > 1);
171173
return `${benchmarkCount.join(" + ")} benchmark${
172174
plural ? "s" : ""
173175
}`;
@@ -176,27 +178,16 @@ const ReportRow = (props: {
176178
<ReportDimension
177179
icon={MEASURE_ICON}
178180
name={(() => {
179-
const counts = report?.results?.map((iteration) =>
180-
iteration?.reduce((acc, result) => {
181-
const c = result?.measures?.length ?? 0;
182-
if (!acc.has(c)) {
183-
acc.add(c);
184-
}
185-
return acc;
186-
}, new Set<number>()),
181+
const measureCount = report?.results?.map(
182+
(iteration) => boundaryLimitsMap(iteration).size,
187183
);
188-
if (counts.length === 0) {
184+
if (measureCount.length === 0) {
189185
return "0 measures";
190186
}
191187
const plural =
192-
counts.length > 1 ||
193-
counts.some(
194-
(count) =>
195-
count.size > 1 || Array.from(count).some((c) => c > 1),
196-
);
197-
return `${counts
198-
.map((iteration) => Array.from(iteration).join(" || "))
199-
.join(" + ")} measure${plural ? "s" : ""}`;
188+
measureCount.length > 1 ||
189+
measureCount.some((count) => count > 1);
190+
return `${measureCount.join(" + ")} measure${plural ? "s" : ""}`;
200191
})()}
201192
/>
202193
<Show when={report?.alerts?.length > 0}>

0 commit comments

Comments
 (0)