Skip to content

Commit 8d81209

Browse files
committed
chore: fix args
1 parent 7af7ef9 commit 8d81209

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/benchmarks/driverBench/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ let bsonType = 'js-bson';
1111
const { inspect } = require('util');
1212
const { writeFile } = require('fs/promises');
1313
const { makeParallelBenchmarks, makeSingleBench, makeMultiBench } = require('../mongoBench/suites');
14+
const { MONGODB_CLIENT_OPTIONS } = require('./common');
1415

1516
const hw = os.cpus();
1617
const ram = os.totalmem() / 1024 ** 3;
@@ -90,7 +91,14 @@ benchmarkRunner
9091
info: {
9192
test_name: benchmarkName,
9293
tags: [bsonType],
93-
args: process.env.MONGODB_CLIENT_OPTIONS ?? ''
94+
// Args can only be a map of string -> int32. So if its a number leave it be,
95+
// if it is anything else test for truthiness and set to 1 or 0.
96+
args: Object.fromEntries(
97+
Object.entries(MONGODB_CLIENT_OPTIONS).map(([key, value]) => [
98+
key,
99+
typeof value === 'number' ? value | 0 : value ? 1 : 0
100+
])
101+
)
94102
},
95103
metrics: [{ name: 'megabytes_per_second', value: result }]
96104
};

0 commit comments

Comments
 (0)