Skip to content

Commit d22abeb

Browse files
committed
PYTHON-5144 - Add async performance benchmarks
1 parent baf0344 commit d22abeb

File tree

5 files changed

+511
-5
lines changed

5 files changed

+511
-5
lines changed

.evergreen/config.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ functions:
508508
params:
509509
working_dir: "src"
510510
binary: bash
511+
include_expansions_in_env: [SUB_TEST_NAME]
511512
args:
512513
- .evergreen/scripts/run-with-env.sh
513514
- .evergreen/scripts/run-perf-tests.sh
@@ -1357,6 +1358,8 @@ tasks:
13571358
VERSION: "v6.0-perf"
13581359
TOPOLOGY: "server"
13591360
- func: "run perf tests"
1361+
vars:
1362+
SUB_TEST_NAME: "sync"
13601363
- func: "attach benchmark test results"
13611364
- func: "send dashboard data"
13621365

@@ -1369,6 +1372,8 @@ tasks:
13691372
TOPOLOGY: "server"
13701373
SSL: "ssl"
13711374
- func: "run perf tests"
1375+
vars:
1376+
SUB_TEST_NAME: "sync"
13721377
- func: "attach benchmark test results"
13731378
- func: "send dashboard data"
13741379

@@ -1380,9 +1385,52 @@ tasks:
13801385
VERSION: "8.0"
13811386
TOPOLOGY: "server"
13821387
- func: "run perf tests"
1388+
vars:
1389+
SUB_TEST_NAME: "sync"
1390+
- func: "attach benchmark test results"
1391+
- func: "send dashboard data"
1392+
1393+
- name: "perf-6.0-standalone-async"
1394+
tags: [ "perf" ]
1395+
commands:
1396+
- func: "bootstrap mongo-orchestration"
1397+
vars:
1398+
VERSION: "v6.0-perf"
1399+
TOPOLOGY: "server"
1400+
- func: "run perf tests"
1401+
vars:
1402+
SUB_TEST_NAME: "async"
1403+
- func: "attach benchmark test results"
1404+
- func: "send dashboard data"
1405+
1406+
- name: "perf-6.0-standalone-ssl-async"
1407+
tags: [ "perf" ]
1408+
commands:
1409+
- func: "bootstrap mongo-orchestration"
1410+
vars:
1411+
VERSION: "v6.0-perf"
1412+
TOPOLOGY: "server"
1413+
SSL: "ssl"
1414+
- func: "run perf tests"
1415+
vars:
1416+
SUB_TEST_NAME: "async"
1417+
- func: "attach benchmark test results"
1418+
- func: "send dashboard data"
1419+
1420+
- name: "perf-8.0-standalone-async"
1421+
tags: [ "perf" ]
1422+
commands:
1423+
- func: "bootstrap mongo-orchestration"
1424+
vars:
1425+
VERSION: "8.0"
1426+
TOPOLOGY: "server"
1427+
- func: "run perf tests"
1428+
vars:
1429+
SUB_TEST_NAME: "async"
13831430
- func: "attach benchmark test results"
13841431
- func: "send dashboard data"
13851432

1433+
13861434
- name: "check-import-time"
13871435
tags: ["pr"]
13881436
commands:
@@ -1463,8 +1511,12 @@ buildvariants:
14631511
- name: "perf-6.0-standalone"
14641512
- name: "perf-6.0-standalone-ssl"
14651513
- name: "perf-8.0-standalone"
1514+
- name: "perf-6.0-standalone-async"
1515+
- name: "perf-6.0-standalone-ssl-async"
1516+
- name: "perf-8.0-standalone-async"
1517+
14661518

1467-
# Platform notes
1519+
# Platform notes
14681520
# i386 builds of OpenSSL or Cyrus SASL are not available
14691521
# Debian 8.1 only supports MongoDB 3.4+
14701522
# SUSE12 s390x is only supported by MongoDB 3.4+

.evergreen/run-perf-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export OUTPUT_FILE="${PROJECT_DIRECTORY}/results.json"
1515

1616
export PYTHON_BINARY=/opt/mongodbtoolchain/v4/bin/python3
1717

18-
bash ./.evergreen/just.sh setup-tests perf
18+
bash ./.evergreen/just.sh setup-tests perf "${SUB_TEST_NAME}"
1919
bash ./.evergreen/just.sh run-tests

.evergreen/scripts/run-perf-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
PROJECT_DIRECTORY=${PROJECT_DIRECTORY}
4-
bash "${PROJECT_DIRECTORY}"/.evergreen/run-perf-tests.sh
4+
SUB_TEST_NAME=${SUB_TEST_NAME} bash "${PROJECT_DIRECTORY}"/.evergreen/run-perf-tests.sh

.evergreen/scripts/setup_tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151

5252
# Tests that require a sub test suite.
53-
SUB_TEST_REQUIRED = ["auth_aws", "kms"]
53+
SUB_TEST_REQUIRED = ["auth_aws", "kms", "perf"]
5454

5555
# Map the test name to test extra.
5656
EXTRAS_MAP = {
@@ -374,7 +374,10 @@ def handle_test_env() -> None:
374374
if test_name == "perf":
375375
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively
376376
# affects the benchmark results.
377-
TEST_ARGS = f"test/performance/perf_test.py {TEST_ARGS}"
377+
if sub_test_name == "sync":
378+
TEST_ARGS = f"test/performance/perf_test.py {TEST_ARGS}"
379+
else:
380+
TEST_ARGS = f"test/performance/async_perf_test.py {TEST_ARGS}"
378381

379382
# Add coverage if requested.
380383
# Only cover CPython. PyPy reports suspiciously low coverage.

0 commit comments

Comments
 (0)