Skip to content

Commit 3329f15

Browse files
authored
RUBY-1250 Run DriverBench benchmarks in Evergreen (#2827)
* refactoring/reimplementation of driver benchmarks * computing scores * supplant profile/benchmarking with profile/driver_bench * make the linter happy * optimize some of the setup stages * add benchmark task to evergreen config * rubocop * add task for downloading benchmark data files * just use run-tests.sh for benchmarks, too * add `eg` tasks for evergreen * tweak more things to get it all to work
1 parent 853c268 commit 3329f15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1934
-1370
lines changed

.evergreen/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,19 @@ functions:
377377
set -x
378378
.evergreen/test-on-docker -d ${os} MONGODB_VERSION=${mongodb-version} TOPOLOGY=${topology} RVM_RUBY=${ruby} -s .evergreen/run-tests.sh TEST_CMD=true ${PRELOAD_ARG}
379379
380+
"run benchmarks":
381+
- command: shell.exec
382+
type: test
383+
params:
384+
shell: bash
385+
working_dir: "src"
386+
script: |
387+
${PREPARE_SHELL}
388+
TEST_CMD="bundle exec rake driver_bench" PERFORMANCE_RESULTS_FILE="$PROJECT_DIRECTORY/perf.json" .evergreen/run-tests.sh
389+
- command: perf.send
390+
params:
391+
file: "${PROJECT_DIRECTORY}/perf.json"
392+
380393
"run tests":
381394
- command: shell.exec
382395
type: test
@@ -665,6 +678,9 @@ tasks:
665678
- name: "test-mlaunch"
666679
commands:
667680
- func: "run tests"
681+
- name: "driver-bench"
682+
commands:
683+
- func: "run benchmarks"
668684
- name: "test-via-docker"
669685
commands:
670686
- func: "run tests via docker"
@@ -1215,6 +1231,16 @@ axes:
12151231
USE_PROXY_SERVERLESS: 1
12161232

12171233
buildvariants:
1234+
- matrix_name: DriverBench
1235+
matrix_spec:
1236+
ruby: "ruby-3.2"
1237+
mongodb-version: latest
1238+
topology: standalone
1239+
run_on: rhel80-large
1240+
display_name: DriverBench
1241+
tasks:
1242+
- name: "driver-bench"
1243+
12181244
- matrix_name: "auth/ssl"
12191245
matrix_spec:
12201246
auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"]

.evergreen/config/common.yml.erb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,19 @@ functions:
374374
set -x
375375
.evergreen/test-on-docker -d ${os} MONGODB_VERSION=${mongodb-version} TOPOLOGY=${topology} RVM_RUBY=${ruby} -s .evergreen/run-tests.sh TEST_CMD=true ${PRELOAD_ARG}
376376

377+
"run benchmarks":
378+
- command: shell.exec
379+
type: test
380+
params:
381+
shell: bash
382+
working_dir: "src"
383+
script: |
384+
${PREPARE_SHELL}
385+
TEST_CMD="bundle exec rake driver_bench" PERFORMANCE_RESULTS_FILE="$PROJECT_DIRECTORY/perf.json" .evergreen/run-tests.sh
386+
- command: perf.send
387+
params:
388+
file: "${PROJECT_DIRECTORY}/perf.json"
389+
377390
"run tests":
378391
- command: shell.exec
379392
type: test
@@ -662,6 +675,9 @@ tasks:
662675
- name: "test-mlaunch"
663676
commands:
664677
- func: "run tests"
678+
- name: "driver-bench"
679+
commands:
680+
- func: "run benchmarks"
665681
- name: "test-via-docker"
666682
commands:
667683
- func: "run tests via docker"

.evergreen/config/standard.yml.erb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@
4141
%>
4242

4343
buildvariants:
44+
- matrix_name: DriverBench
45+
matrix_spec:
46+
ruby: <%= latest_ruby %>
47+
mongodb-version: latest
48+
topology: standalone
49+
run_on: rhel80-large
50+
display_name: DriverBench
51+
tasks:
52+
- name: "driver-bench"
53+
4454
- matrix_name: "auth/ssl"
4555
matrix_spec:
4656
auth-and-ssl: ["auth-and-ssl", "noauth-and-nossl"]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ gemfiles/*.gemfile.lock
2626
.env.private*
2727
.env
2828
build
29-
profile/benchmarking/data
29+
profile/data
3030
secrets-export.sh
3131
secrets-expansion.yml
3232
atlas-expansion.yml

Rakefile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,32 @@ end
119119

120120
task :release => ['release:check_private_key', 'release:do']
121121

122+
desc 'Build and validate the evergreen config'
123+
task eg: %w[ eg:build eg:validate ]
124+
125+
# 'eg' == 'evergreen', but evergreen is too many letters for convenience
126+
namespace :eg do
127+
desc 'Builds the .evergreen/config.yml file from the templates'
128+
task :build do
129+
ruby '.evergreen/update-evergreen-configs'
130+
end
131+
132+
desc 'Validates the .evergreen/config.yml file'
133+
task :validate do
134+
system 'evergreen validate --project mongo-ruby-driver .evergreen/config.yml'
135+
end
136+
137+
desc 'Updates the evergreen executable to the latest available version'
138+
task :update do
139+
system 'evergreen get-update --install'
140+
end
141+
142+
desc 'Runs the current branch as an evergreen patch'
143+
task :patch do
144+
system 'evergreen patch --uncommitted --project mongo-ruby-driver --browse --auto-description --yes'
145+
end
146+
end
147+
122148
desc "Generate all documentation"
123149
task :docs => 'docs:yard'
124150

@@ -131,4 +157,4 @@ namespace :docs do
131157
end
132158
end
133159

134-
load 'profile/benchmarking/rake/tasks.rake'
160+
load 'profile/driver_bench/rake/tasks.rake'

lib/mongo/grid/fs_bucket.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,12 @@ def write_concern
484484
end
485485
end
486486

487+
# Drop the collections that implement this bucket.
488+
def drop
489+
files_collection.drop
490+
chunks_collection.drop
491+
end
492+
487493
private
488494

489495
# @param [ Hash ] opts The options.

profile/benchmark_21.rb

Lines changed: 0 additions & 62 deletions
This file was deleted.

profile/benchmarking.rb

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)