Skip to content

Commit e6e8650

Browse files
authored
PYTHON-5144 - Add async performance benchmarks (#2188)
1 parent 5e055ee commit e6e8650

File tree

5 files changed

+523
-17
lines changed

5 files changed

+523
-17
lines changed

.evergreen/config.yml

+51-14
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ functions:
321321
params:
322322
working_dir: "src"
323323
binary: bash
324+
include_expansions_in_env: [SUB_TEST_NAME]
324325
args:
325326
- .evergreen/scripts/run-with-env.sh
326327
- .evergreen/scripts/run-perf-tests.sh
@@ -512,6 +513,8 @@ tasks:
512513
vars:
513514
VERSION: "v6.0-perf"
514515
- func: "run perf tests"
516+
vars:
517+
SUB_TEST_NAME: "sync"
515518
- func: "attach benchmark test results"
516519
- func: "send dashboard data"
517520

@@ -523,6 +526,8 @@ tasks:
523526
VERSION: "v6.0-perf"
524527
SSL: "ssl"
525528
- func: "run perf tests"
529+
vars:
530+
SUB_TEST_NAME: "sync"
526531
- func: "attach benchmark test results"
527532
- func: "send dashboard data"
528533

@@ -533,9 +538,52 @@ tasks:
533538
vars:
534539
VERSION: "8.0"
535540
- func: "run perf tests"
541+
vars:
542+
SUB_TEST_NAME: "sync"
543+
- func: "attach benchmark test results"
544+
- func: "send dashboard data"
545+
546+
- name: "perf-6.0-standalone-async"
547+
tags: [ "perf" ]
548+
commands:
549+
- func: "run server"
550+
vars:
551+
VERSION: "v6.0-perf"
552+
TOPOLOGY: "server"
553+
- func: "run perf tests"
554+
vars:
555+
SUB_TEST_NAME: "async"
556+
- func: "attach benchmark test results"
557+
- func: "send dashboard data"
558+
559+
- name: "perf-6.0-standalone-ssl-async"
560+
tags: [ "perf" ]
561+
commands:
562+
- func: "run server"
563+
vars:
564+
VERSION: "v6.0-perf"
565+
TOPOLOGY: "server"
566+
SSL: "ssl"
567+
- func: "run perf tests"
568+
vars:
569+
SUB_TEST_NAME: "async"
570+
- func: "attach benchmark test results"
571+
- func: "send dashboard data"
572+
573+
- name: "perf-8.0-standalone-async"
574+
tags: [ "perf" ]
575+
commands:
576+
- func: "run server"
577+
vars:
578+
VERSION: "8.0"
579+
TOPOLOGY: "server"
580+
- func: "run perf tests"
581+
vars:
582+
SUB_TEST_NAME: "async"
536583
- func: "attach benchmark test results"
537584
- func: "send dashboard data"
538585

586+
539587
- name: "check-import-time"
540588
tags: ["pr"]
541589
commands:
@@ -616,17 +664,6 @@ buildvariants:
616664
- name: "perf-6.0-standalone"
617665
- name: "perf-6.0-standalone-ssl"
618666
- name: "perf-8.0-standalone"
619-
620-
# Platform notes
621-
# i386 builds of OpenSSL or Cyrus SASL are not available
622-
# Debian 8.1 only supports MongoDB 3.4+
623-
# SUSE12 s390x is only supported by MongoDB 3.4+
624-
# No enterprise build for Archlinux, SSL not available
625-
# RHEL 7.6 and RHEL 8.4 only supports 3.6+.
626-
# RHEL 7 only supports 2.6+
627-
# RHEL 7.1 ppc64le is only supported by MongoDB 3.2+
628-
# RHEL 7.2 s390x is only supported by MongoDB 3.4+
629-
# Solaris MongoDB SSL builds are not available
630-
# Darwin MongoDB SSL builds are not available for 2.6
631-
# SUSE12 x86_64 is only supported by MongoDB 3.2+
632-
# vim: set et sw=2 ts=2 :
667+
- name: "perf-6.0-standalone-async"
668+
- name: "perf-6.0-standalone-ssl-async"
669+
- name: "perf-8.0-standalone-async"

.evergreen/run-perf-tests.sh

+1-1
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

+1-1
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

+4-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ def handle_test_env() -> None:
359359
if test_name == "perf":
360360
# PYTHON-4769 Run perf_test.py directly otherwise pytest's test collection negatively
361361
# affects the benchmark results.
362-
TEST_ARGS = f"test/performance/perf_test.py {TEST_ARGS}"
362+
if sub_test_name == "sync":
363+
TEST_ARGS = f"test/performance/perf_test.py {TEST_ARGS}"
364+
else:
365+
TEST_ARGS = f"test/performance/async_perf_test.py {TEST_ARGS}"
363366

364367
# Add coverage if requested.
365368
# Only cover CPython. PyPy reports suspiciously low coverage.

0 commit comments

Comments
 (0)