@@ -110,12 +110,12 @@ for (const [suite, benchmarks] of Object.entries(tests)) {
110
110
console . groupEnd ( ) ;
111
111
}
112
112
113
- const aMetricInfo =
113
+ const metricInfoFilterByName =
114
114
( testName : string ) =>
115
115
( { info : { test_name } } : MetricInfo ) =>
116
116
test_name === testName ;
117
117
118
- const anMBsMetric = ( { name } : Metric ) => name === 'megabytes_per_second' ;
118
+ const isMBsMetric = ( { name } : Metric ) => name === 'megabytes_per_second' ;
119
119
120
120
function calculateCompositeBenchmarks ( results : MetricInfo [ ] ) {
121
121
const composites = {
@@ -162,10 +162,10 @@ function calculateCompositeBenchmarks(results: MetricInfo[]) {
162
162
163
163
let sum = 0 ;
164
164
for ( const testName of compositeTests ) {
165
- const testScore = results . find ( aMetricInfo ( testName ) ) ;
165
+ const testScore = results . find ( metricInfoFilterByName ( testName ) ) ;
166
166
assert . ok ( testScore , `${ compositeName } suite requires ${ testName } for composite score` ) ;
167
167
168
- const metric = testScore . metrics . find ( anMBsMetric ) ;
168
+ const metric = testScore . metrics . find ( isMBsMetric ) ;
169
169
assert . ok ( metric , `${ testName } is missing a megabytes_per_second metric` ) ;
170
170
171
171
sum += metric . value ;
@@ -199,22 +199,22 @@ function calculateCompositeBenchmarks(results: MetricInfo[]) {
199
199
}
200
200
201
201
function calculateNormalizedResults ( results : MetricInfo [ ] ) : MetricInfo [ ] {
202
- const baselineBench = results . find ( aMetricInfo ( 'cpuBaseline' ) ) ;
203
- const pingBench = results . find ( aMetricInfo ( 'ping' ) ) ;
202
+ const baselineBench = results . find ( metricInfoFilterByName ( 'cpuBaseline' ) ) ;
203
+ const pingBench = results . find ( metricInfoFilterByName ( 'ping' ) ) ;
204
204
205
205
assert . ok ( pingBench , 'ping bench results not found!' ) ;
206
206
assert . ok ( baselineBench , 'cpuBaseline results not found!' ) ;
207
207
208
- const cpuBaseline = baselineBench . metrics . find ( anMBsMetric ) ;
209
- const pingThroughput = pingBench . metrics . find ( anMBsMetric ) ;
208
+ const cpuBaseline = baselineBench . metrics . find ( isMBsMetric ) ;
209
+ const pingThroughput = pingBench . metrics . find ( isMBsMetric ) ;
210
210
211
211
assert . ok ( cpuBaseline , 'cpu benchmark does not have a MB/s metric' ) ;
212
212
assert . ok ( pingThroughput , 'ping does not have a MB/s metric' ) ;
213
213
214
214
for ( const bench of results ) {
215
215
if ( bench . info . test_name === 'cpuBaseline' ) continue ;
216
216
217
- const currentMetric = bench . metrics . find ( anMBsMetric ) ;
217
+ const currentMetric = bench . metrics . find ( isMBsMetric ) ;
218
218
assert . ok ( currentMetric , `${ bench . info . test_name } does not have a MB/s metric` ) ;
219
219
220
220
if ( bench . info . test_name === 'ping' ) {
0 commit comments