Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ tasks:
- func: bootstrap kms servers
- func: "run serverless tests"

- name: run-spec-benchmark-tests-node-18-server-6.0
- name: run-spec-benchmark-tests-node-server
tags:
- run-spec-benchmark-tests
- performance
Expand All @@ -1157,8 +1157,7 @@ tasks:
type: setup
params:
updates:
- { key: NODE_LTS_VERSION, value: v18.16.0 }
- { key: NPM_VERSION, value: "9" }
- { key: NODE_LTS_VERSION, value: v22.11.0 }
- { key: VERSION, value: v6.0-perf }
- { key: TOPOLOGY, value: server }
- { key: AUTH, value: noauth }
Expand Down Expand Up @@ -1616,4 +1615,4 @@ buildvariants:
display_name: Performance Test
run_on: rhel90-dbx-perf-large
tasks:
- run-spec-benchmark-tests-node-18-server-6.0
- run-spec-benchmark-tests-node-server
7 changes: 3 additions & 4 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ tasks:
- func: install dependencies
- func: bootstrap kms servers
- func: run serverless tests
- name: run-spec-benchmark-tests-node-18-server-6.0
- name: run-spec-benchmark-tests-node-server
tags:
- run-spec-benchmark-tests
- performance
Expand All @@ -1118,8 +1118,7 @@ tasks:
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: v18.16.0}
- {key: NPM_VERSION, value: '9'}
- {key: NODE_LTS_VERSION, value: v22.11.0}
- {key: VERSION, value: v6.0-perf}
- {key: TOPOLOGY, value: server}
- {key: AUTH, value: noauth}
Expand Down Expand Up @@ -4547,7 +4546,7 @@ buildvariants:
display_name: Performance Test
run_on: rhel90-dbx-perf-large
tasks:
- run-spec-benchmark-tests-node-18-server-6.0
- run-spec-benchmark-tests-node-server
- name: rhel80-large-gallium
display_name: rhel8 Node16
run_on: rhel80-large
Expand Down
6 changes: 5 additions & 1 deletion test/benchmarks/mongoBench/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ const DEFAULT_MAX_EXECUTION_TIME =
const DEFAULT_MIN_EXECUTION_COUNT =
Number.parseInt(process.env.DRIVER_BENCH_MIN_EX_COUNT, 10) || 100;

const DEFAULT_MAX_EXECUTION_COUNT =
Number.parseInt(process.env.DRIVER_BENCH_MAX_EX_COUNT, 10) || 10000000;

module.exports = {
DEFAULT_MIN_EXECUTION_COUNT,
DEFAULT_MIN_EXECUTION_TIME,
DEFAULT_MAX_EXECUTION_TIME
DEFAULT_MAX_EXECUTION_TIME,
DEFAULT_MAX_EXECUTION_COUNT
};
8 changes: 7 additions & 1 deletion test/benchmarks/mongoBench/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Runner {
this.minExecutionTime = options.minExecutionTime || CONSTANTS.DEFAULT_MIN_EXECUTION_TIME;
this.maxExecutionTime = options.maxExecutionTime || CONSTANTS.DEFAULT_MAX_EXECUTION_TIME;
this.minExecutionCount = options.minExecutionCount || CONSTANTS.DEFAULT_MIN_EXECUTION_COUNT;
this.minExecutionCount = options.maxExecutionCount || CONSTANTS.DEFAULT_MAX_EXECUTION_COUNT;
this.reporter =
options.reporter ||
function () {
Expand Down Expand Up @@ -162,12 +163,17 @@ class Runner {
const minExecutionCount = this.minExecutionCount;
const minExecutionTime = this.minExecutionTime;
const maxExecutionTime = this.maxExecutionTime;
const maxExecutionAttempts = this.minExecutionCount;
let time = performance.now() - start;
let count = 1;

const taskTimer = benchmark._taskType === 'sync' ? timeSyncTask : timeAsyncTask;

while (time < maxExecutionTime && (time < minExecutionTime || count < minExecutionCount)) {
while (
time < maxExecutionTime &&
(time < minExecutionTime || count < minExecutionCount) &&
count < maxExecutionAttempts
) {
await benchmark.beforeTask.call(ctx);
const executionTime = await taskTimer(benchmark.task, ctx);
rawData.push(executionTime);
Expand Down