1
1
'use strict' ;
2
2
3
3
const MongoBench = require ( '../mongoBench' ) ;
4
- const process = require ( 'node:process' ) ;
5
4
const os = require ( 'node:os' ) ;
6
- const util = require ( 'node:util' ) ;
7
-
8
- const args = util . parseArgs ( {
9
- args : process . argv . slice ( 2 ) ,
10
- options : {
11
- grep : {
12
- short : 'g' ,
13
- type : 'string' ,
14
- required : false
15
- }
16
- }
17
- } ) ;
18
5
19
6
const Runner = MongoBench . Runner ;
20
7
21
8
let bsonType = 'js-bson' ;
22
9
// TODO(NODE-4606): test against different driver configurations in CI
23
10
11
+ const { inspect } = require ( 'util' ) ;
24
12
const { writeFile } = require ( 'fs/promises' ) ;
25
13
const { makeParallelBenchmarks, makeSingleBench, makeMultiBench } = require ( '../mongoBench/suites' ) ;
26
14
@@ -42,9 +30,7 @@ function average(arr) {
42
30
return arr . reduce ( ( x , y ) => x + y , 0 ) / arr . length ;
43
31
}
44
32
45
- const benchmarkRunner = new Runner ( {
46
- grep : args . values . grep ?? null
47
- } )
33
+ const benchmarkRunner = new Runner ( )
48
34
. suite ( 'singleBench' , suite => makeSingleBench ( suite ) )
49
35
. suite ( 'multiBench' , suite => makeMultiBench ( suite ) )
50
36
. suite ( 'parallel' , suite => makeParallelBenchmarks ( suite ) ) ;
@@ -110,7 +96,7 @@ benchmarkRunner
110
96
} )
111
97
. then ( data => {
112
98
const results = JSON . stringify ( data , undefined , 2 ) ;
113
- console . log ( util . inspect ( data , { depth : Infinity , colors : true } ) ) ;
99
+ console . log ( inspect ( data , { depth : Infinity , colors : true } ) ) ;
114
100
return writeFile ( 'results.json' , results ) ;
115
101
} )
116
102
. catch ( err => console . error ( err ) ) ;
0 commit comments