22
33const MongoBench = require ( '../mongoBench' ) ;
44const os = require ( 'node:os' ) ;
5- const util = require ( 'node:util' ) ;
65const process = require ( 'node:process' ) ;
76
87const Runner = MongoBench . Runner ;
@@ -11,18 +10,8 @@ let bsonType = 'js-bson';
1110// TODO(NODE-4606): test against different driver configurations in CI
1211
1312const { writeFile } = require ( 'fs/promises' ) ;
14- const {
15- makeParallelBenchmarks /* makeSingleBench, makeMultiBench */
16- } = require ( '../mongoBench/suites' ) ;
17- const {
18- MONGODB_CLIENT_OPTIONS ,
19- MONGODB_DRIVER_PATH ,
20- MONGODB_DRIVER_VERSION ,
21- MONGODB_DRIVER_REVISION ,
22- MONGODB_BSON_PATH ,
23- MONGODB_BSON_VERSION ,
24- MONGODB_BSON_REVISION
25- } = require ( './common' ) ;
13+ const { makeParallelBenchmarks, makeSingleBench, makeMultiBench } = require ( '../mongoBench/suites' ) ;
14+ const { MONGODB_CLIENT_OPTIONS } = require ( './common' ) ;
2615
2716const hw = os . cpus ( ) ;
2817const ram = os . totalmem ( ) / 1024 ** 3 ;
@@ -35,10 +24,7 @@ const systemInfo = () =>
3524 `- arch: ${ os . arch ( ) } ` ,
3625 `- os: ${ process . platform } (${ os . release ( ) } )` ,
3726 `- ram: ${ platform . ram } ` ,
38- `- node: ${ process . version } ` ,
39- `- driver: ${ MONGODB_DRIVER_VERSION } (${ MONGODB_DRIVER_REVISION } ): ${ MONGODB_DRIVER_PATH } ` ,
40- ` - options ${ util . inspect ( MONGODB_CLIENT_OPTIONS ) } ` ,
41- `- bson: ${ MONGODB_BSON_VERSION } (${ MONGODB_BSON_REVISION } ): (${ MONGODB_BSON_PATH } )\n`
27+ `- node: ${ process . version } \n`
4228 ] . join ( '\n' ) ;
4329console . log ( systemInfo ( ) ) ;
4430
@@ -47,19 +33,23 @@ function average(arr) {
4733}
4834
4935const benchmarkRunner = new Runner ( )
50- // .suite('singleBench', suite => makeSingleBench(suite))
51- // .suite('multiBench', suite => makeMultiBench(suite))
36+ . suite ( 'singleBench' , suite => makeSingleBench ( suite ) )
37+ . suite ( 'multiBench' , suite => makeMultiBench ( suite ) )
5238 . suite ( 'parallel' , suite => makeParallelBenchmarks ( suite ) ) ;
5339
5440benchmarkRunner
5541 . run ( )
5642 . then ( microBench => {
57- // const singleBench = average([
58- // microBench.singleBench.findOne,
59- // microBench.singleBench.smallDocInsertOne,
60- // microBench.singleBench.largeDocInsertOne
61- // ]);
62- // const multiBench = average(Object.values(microBench.multiBench));
43+ const singleBench = average ( [
44+ microBench . singleBench . findOne ,
45+ microBench . singleBench . smallDocInsertOne ,
46+ microBench . singleBench . largeDocInsertOne
47+ ] ) ;
48+ const multiBench = average ( Object . values ( microBench . multiBench ) ) ;
49+
50+ // ldjsonMultiFileUpload and ldjsonMultiFileExport cause connection errors.
51+ // While we investigate, we will use the last known good values:
52+ // https://spruce.mongodb.com/task/mongo_node_driver_next_performance_tests_run_spec_benchmark_tests_node_server_4bc3e500b6f0e8ab01f052c4a1bfb782d6a29b4e_f168e1328f821bbda265e024cc91ae54_24_11_18_15_37_24/logs?execution=0
6353
6454 const parallelBench = average ( [
6555 microBench . parallel . ldjsonMultiFileUpload ,
@@ -69,27 +59,27 @@ benchmarkRunner
6959 ] ) ;
7060
7161 const readBench = average ( [
72- // microBench.singleBench.findOne,
73- // microBench.multiBench.findManyAndEmptyCursor,
74- // microBench.multiBench.gridFsDownload,
62+ microBench . singleBench . findOne ,
63+ microBench . multiBench . findManyAndEmptyCursor ,
64+ microBench . multiBench . gridFsDownload ,
7565 microBench . parallel . gridfsMultiFileDownload ,
7666 microBench . parallel . ldjsonMultiFileExport
7767 ] ) ;
7868 const writeBench = average ( [
79- // microBench.singleBench.smallDocInsertOne,
80- // microBench.singleBench.largeDocInsertOne,
81- // microBench.multiBench.smallDocBulkInsert,
82- // microBench.multiBench.largeDocBulkInsert,
83- // microBench.multiBench.gridFsUpload,
69+ microBench . singleBench . smallDocInsertOne ,
70+ microBench . singleBench . largeDocInsertOne ,
71+ microBench . multiBench . smallDocBulkInsert ,
72+ microBench . multiBench . largeDocBulkInsert ,
73+ microBench . multiBench . gridFsUpload ,
8474 microBench . parallel . ldjsonMultiFileUpload ,
8575 microBench . parallel . gridfsMultiFileUpload
8676 ] ) ;
8777
8878 const driverBench = average ( [ readBench , writeBench ] ) ;
8979
9080 const benchmarkResults = {
91- // singleBench,
92- // multiBench,
81+ singleBench,
82+ multiBench,
9383 parallelBench,
9484 readBench,
9585 writeBench,
@@ -123,6 +113,6 @@ benchmarkRunner
123113 return writeFile ( 'results.json' , results ) ;
124114 } )
125115 . catch ( err => {
126- console . error ( 'failure: ' , err . name , err . message , err . stack ) ;
116+ console . error ( 'failure: ' , err . name , err . message ) ;
127117 process . exit ( 1 ) ;
128118 } ) ;
0 commit comments