You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/readme.md
+42
Original file line number
Diff line number
Diff line change
@@ -241,6 +241,48 @@ beforeEach(() => {
241
241
});
242
242
```
243
243
244
+
## Running Benchmarks
245
+
246
+
Refer to the `run-spec-benchmark-tests-node-server` task for Node.js version, MongoDB server version, and platform that we run benchmarks against in CI.
247
+
248
+
The server is run in standalone mode and the server versions are aliased by this script: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/5048cca80e9ca62642409de2d401058bbd7057fa/.evergreen/mongodl.py#L58 check the latest version to see what alias the driver is running against.
249
+
250
+
The host used is described here: https://spruce.mongodb.com/distro/rhel90-dbx-perf-large/settings/general (Auth required to view)
251
+
252
+
It is best to try reproductions against as similar a deployment as possible to isolate regressions.
253
+
254
+
### Configuration
255
+
256
+
The benchmarks can be directed to test different settings and driver versions.
257
+
258
+
The following are environment variables and how the benchmark runner uses them:
259
+
260
+
-`MONGODB_DRIVER_PATH` - if set MUST be set to the directory a driver version is in, usually another clone of the driver checked out to a different revision.
261
+
-`MONGODB_CLIENT_OPTIONS` - if set MUST be a JSON string that will be parsed and passed as the second argument to the MongoClient constructor.
262
+
-`MONGODB_URI` - if set MUST be a valid MongoDB connection string and it will be used as the host the benchmarks will run against.
263
+
264
+
It may be desirable to test how changes to `BSON` impact the driver's performance.
265
+
266
+
To do this:
267
+
- clone the changed version of BSON
268
+
- run the build script for that repo (usually done by `npm install` for you)
269
+
- run `npm link`
270
+
- over in the driver repo run `npm link bson`
271
+
272
+
When you run the benchmarks verify that the BSON version has been picked by the version references that are printed out:
273
+
274
+
```md
275
+
- cpu: Apple M1 Max
276
+
- cores: 10
277
+
- arch: arm64
278
+
- os: darwin (23.6.0)
279
+
- ram: 32GB
280
+
- node: v22.6.0
281
+
- driver: 6.11.0 (df3ea32a9): .../mongodb
282
+
- options {}
283
+
- bson: 6.10.1 (installed from npm): (.../mongodb/node_modules/bson)
284
+
```
285
+
244
286
## Testing with Special Environments
245
287
246
288
In order to test some features, you will need to generate and set a specialized group of environment variables. The subsections below will walk you through how to generate and set the environment variables for these features.
0 commit comments