Skip to content

Commit b3b79eb

Browse files
W-A-Jamesnbbeeken
authored andcommitted
chore: test csot perf
1 parent 88c5368 commit b3b79eb

File tree

4 files changed

+71
-4
lines changed

4 files changed

+71
-4
lines changed

.evergreen/config.in.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ functions:
11021102
env:
11031103
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
11041104
MONGODB_URI: ${MONGODB_URI}
1105+
MONGODB_CLIENT_OPTIONS: ${MONGODB_CLIENT_OPTIONS}
11051106
binary: bash
11061107
args:
11071108
- ${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh
@@ -1168,6 +1169,53 @@ tasks:
11681169
params:
11691170
file: src/results.json
11701171

1172+
- name: run-spec-benchmark-tests-node-18-server-6.0-timeoutMS-120000
1173+
tags:
1174+
- run-spec-benchmark-tests
1175+
- performance
1176+
exec_timeout_secs: 3600
1177+
commands:
1178+
- command: expansions.update
1179+
type: setup
1180+
params:
1181+
updates:
1182+
- { key: NODE_LTS_VERSION, value: v18.16.0 }
1183+
- { key: NPM_VERSION, value: "9" }
1184+
- { key: VERSION, value: v6.0-perf }
1185+
- { key: TOPOLOGY, value: server }
1186+
- { key: AUTH, value: noauth }
1187+
- { key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 120000}' }
1188+
- func: install dependencies
1189+
- func: bootstrap mongo-orchestration
1190+
- func: run spec driver benchmarks
1191+
- command: perf.send
1192+
params:
1193+
file: src/results.json
1194+
1195+
- name: run-spec-benchmark-tests-node-18-server-6.0-timeoutMS-0
1196+
tags:
1197+
- run-spec-benchmark-tests
1198+
- performance
1199+
exec_timeout_secs: 3600
1200+
commands:
1201+
- command: expansions.update
1202+
type: setup
1203+
params:
1204+
updates:
1205+
- { key: NODE_LTS_VERSION, value: v18.16.0 }
1206+
- { key: NPM_VERSION, value: "9" }
1207+
- { key: VERSION, value: v6.0-perf }
1208+
- { key: TOPOLOGY, value: server }
1209+
- { key: AUTH, value: noauth }
1210+
- { key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 0}' }
1211+
- func: install dependencies
1212+
- func: bootstrap mongo-orchestration
1213+
- func: run spec driver benchmarks
1214+
- command: perf.send
1215+
params:
1216+
file: src/results.json
1217+
1218+
11711219
- name: "test-gcpkms-task"
11721220
commands:
11731221
- command: expansions.update
@@ -1628,3 +1676,5 @@ buildvariants:
16281676
run_on: rhel90-dbx-perf-large
16291677
tasks:
16301678
- run-spec-benchmark-tests-node-18-server-6.0
1679+
- run-spec-benchmark-tests-node-18-server-6.0-timeoutMS-120000
1680+
- run-spec-benchmark-tests-node-18-server-6.0-timeoutMS-0

.evergreen/run-benchmarks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
44

55
export MONGODB_URI=$MONGODB_URI
6+
export MONGODB_CLIENT_OPTIONS=$MONGODB_CLIENT_OPTIONS
67

78
npm run build:ts
89
npm run check:bench

test/benchmarks/driverBench/common.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,22 @@ function loadSpecString(filePath) {
2323
return loadSpecFile(filePath, 'utf8');
2424
}
2525

26+
const MONGODB_CLIENT_OPTIONS = (() => {
27+
const optionsString = process.env.MONGODB_CLIENT_OPTIONS;
28+
let options = undefined;
29+
if (optionsString?.length) {
30+
options = JSON.parse(optionsString);
31+
}
32+
return { ...options };
33+
})();
34+
35+
const MONGODB_URI = (() => {
36+
if (process.env.MONGODB_URI?.length) return process.env.MONGODB_URI;
37+
return 'mongodb://127.0.0.1:27017';
38+
})();
39+
2640
function makeClient() {
27-
this.client = new MongoClient(process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017', {
28-
timeoutMS: 0
29-
});
41+
this.client = new MongoClient(MONGODB_URI, MONGODB_CLIENT_OPTIONS);
3042
}
3143

3244
function connectClient() {
@@ -103,6 +115,8 @@ async function writeSingleByteFileToBucket() {
103115
}
104116

105117
module.exports = {
118+
MONGODB_URI,
119+
MONGODB_CLIENT_OPTIONS,
106120
makeClient,
107121
connectClient,
108122
disconnectClient,

test/benchmarks/driverBench/index.js

Lines changed: 3 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_URI, MONGODB_CLIENT_OPTIONS } = require('./common');
1415

1516
const hw = os.cpus();
1617
const ram = os.totalmem() / 1024 ** 3;
@@ -88,7 +89,8 @@ benchmarkRunner
8889
return {
8990
info: {
9091
test_name: benchmarkName,
91-
tags: [bsonType]
92+
tags: [bsonType],
93+
args: { MONGODB_URI, MONGODB_CLIENT_OPTIONS }
9294
},
9395
metrics: [{ name: 'megabytes_per_second', value: result }]
9496
};

0 commit comments

Comments
 (0)