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" ;
2
7
import type { PerfTab } from "../../../../../config/types" ;
3
8
import { fmtDateTime , resourcePath } from "../../../../../config/util" ;
4
9
import type { JsonReport } from "../../../../../types/bencher" ;
5
10
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" ;
12
11
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" ;
15
17
16
18
const ReportsTab = ( props : {
17
19
project_slug : Accessor < undefined | string > ;
@@ -167,7 +169,7 @@ const ReportRow = (props: {
167
169
}
168
170
const plural =
169
171
benchmarkCount . length > 1 ||
170
- benchmarkCount . filter ( ( count ) => count > 1 ) . length > 0 ;
172
+ benchmarkCount . some ( ( count ) => count > 1 ) ;
171
173
return `${ benchmarkCount . join ( " + " ) } benchmark${
172
174
plural ? "s" : ""
173
175
} `;
@@ -176,27 +178,16 @@ const ReportRow = (props: {
176
178
< ReportDimension
177
179
icon = { MEASURE_ICON }
178
180
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 ,
187
183
) ;
188
- if ( counts . length === 0 ) {
184
+ if ( measureCount . length === 0 ) {
189
185
return "0 measures" ;
190
186
}
191
187
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" : "" } ` ;
200
191
} ) ( ) }
201
192
/>
202
193
< Show when = { report ?. alerts ?. length > 0 } >
0 commit comments