File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
test/benchmarks/driver_bench Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,23 @@ npm start
1010
1111will build the benchmarks and run them.
1212
13+ ## Environment Configuration and Setup
14+
15+ The benchmarks respond to a few environment variables:
16+
17+ - ` MONGODB_URI `
18+ - The connection string to run operations against.
19+ CI uses a standalone, you should be able to launch any cluster and point the benchmarks at it via this env var.
20+ - default: ` "mongodb://localhost:27017" `
21+ - ` MONGODB_DRIVER_PATH `
22+ - The path to the MongoDB Node.js driver.
23+ This MUST be set to the _ directory_ the driver is installed in.
24+ ** NOT** the file "lib/index.js" that is the driver's export.
25+ - default: 4 directories above driver.mjs (should be the root of this repo)
26+ - ` MONGODB_CLIENT_OPTIONS `
27+ - A JSON string that will be passed to the MongoClient constructor
28+ - default: ` "{}" `
29+
1330## Running individual benchmarks
1431
1532` main.mjs ` loops and launches the bench runner for you.
Original file line number Diff line number Diff line change @@ -88,8 +88,11 @@ export const MONGODB_CLIENT_OPTIONS = (() => {
8888} ) ( ) ;
8989
9090export const MONGODB_URI = ( ( ) => {
91- if ( process . env . MONGODB_URI ?. length ) return process . env . MONGODB_URI ;
92- return 'mongodb://127.0.0.1:27017' ;
91+ const connectionString = process . env . MONGODB_URI ;
92+ if ( connectionString ?. length ) {
93+ return connectionString ;
94+ }
95+ return 'mongodb://localhost:27017' ;
9396} ) ( ) ;
9497
9598export function snakeToCamel ( name : string ) {
You can’t perform that action at this time.
0 commit comments