@@ -131,165 +131,4 @@ namespace :docs do
131
131
end
132
132
end
133
133
134
- require_relative "profile/benchmarking"
135
-
136
- # Some require data files, available from the drivers team. See the comments above each task for details."
137
- namespace :benchmark do
138
- desc "Run the bson benchmarking tests"
139
- task :bson do
140
- puts "BSON BENCHMARK"
141
- Mongo ::Benchmarking . report ( {
142
- bson : Mongo ::Benchmarking ::BSON . run_all ( {
143
- flat : %i[ encode decode ] ,
144
- deep : %i[ encode decode ] ,
145
- full : %i[ encode decode ] ,
146
- } )
147
- } )
148
- end
149
-
150
- namespace :bson do
151
- namespace :flat do
152
- desc "Benchmarking for flat bson documents."
153
-
154
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called flat_bson.json.
155
- task :encode do
156
- puts "BSON BENCHMARK :: FLAT :: ENCODE"
157
- Mongo ::Benchmarking . report ( { bson : { flat : { encode : Mongo ::Benchmarking ::BSON . run ( :flat , :encode ) } } } )
158
- end
159
-
160
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called flat_bson.json.
161
- task :decode do
162
- puts "BSON BENCHMARK :: FLAT :: DECODE"
163
- Mongo ::Benchmarking . report ( { bson : { flat : { decode : Mongo ::Benchmarking ::BSON . run ( :flat , :decode ) } } } )
164
- end
165
- end
166
-
167
- namespace :deep do
168
- desc "Benchmarking for deep bson documents."
169
-
170
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called deep_bson.json.
171
- task :encode do
172
- puts "BSON BENCHMARK :: DEEP :: ENCODE"
173
- Mongo ::Benchmarking . report ( { bson : { deep : { encode : Mongo ::Benchmarking ::BSON . run ( :deep , :encode ) } } } )
174
- end
175
-
176
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called deep_bson.json.
177
- task :decode do
178
- puts "BSON BENCHMARK :: DEEP :: DECODE"
179
- Mongo ::Benchmarking . report ( { bson : { deep : { decode : Mongo ::Benchmarking ::BSON . run ( :deep , :decode ) } } } )
180
- end
181
- end
182
-
183
- namespace :full do
184
- desc "Benchmarking for full bson documents."
185
-
186
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called full_bson.json.
187
- task :encode do
188
- puts "BSON BENCHMARK :: FULL :: ENCODE"
189
- Mongo ::Benchmarking . report ( { bson : { full : { encode : Mongo ::Benchmarking ::BSON . run ( :full , :encode ) } } } )
190
- end
191
-
192
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called full_bson.json.
193
- task :decode do
194
- puts "BSON BENCHMARK :: FULL :: DECODE"
195
- Mongo ::Benchmarking . report ( { bson : { full : { decode : Mongo ::Benchmarking ::BSON . run ( :full , :decode ) } } } )
196
- end
197
- end
198
- end
199
-
200
- namespace :single_doc do
201
- desc "Run the common driver single-document benchmarking tests"
202
- task :command do
203
- puts "SINGLE DOC BENCHMARK:: COMMAND"
204
- Mongo ::Benchmarking ::SingleDoc . run ( :command )
205
- end
206
-
207
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called TWEET.json.
208
- task :find_one do
209
- puts "SINGLE DOC BENCHMARK:: FIND ONE BY ID"
210
- Mongo ::Benchmarking ::SingleDoc . run ( :find_one )
211
- end
212
-
213
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called SMALL_DOC.json.
214
- task :insert_one_small do
215
- puts "SINGLE DOC BENCHMARK:: INSERT ONE SMALL DOCUMENT"
216
- Mongo ::Benchmarking ::SingleDoc . run ( :insert_one_small )
217
- end
218
-
219
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called LARGE_DOC.json.
220
- task :insert_one_large do
221
- puts "SINGLE DOC BENCHMARK:: INSERT ONE LARGE DOCUMENT"
222
- Mongo ::Benchmarking ::SingleDoc . run ( :insert_one_large )
223
- end
224
- end
225
-
226
- namespace :multi_doc do
227
- desc "Run the common driver multi-document benchmarking tests"
228
-
229
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called TWEET.json.
230
- task :find_many do
231
- puts "MULTI DOCUMENT BENCHMARK:: FIND MANY"
232
- Mongo ::Benchmarking ::MultiDoc . run ( :find_many )
233
- end
234
-
235
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called SMALL_DOC.json.
236
- task :bulk_insert_small do
237
- puts "MULTI DOCUMENT BENCHMARK:: BULK INSERT SMALL"
238
- Mongo ::Benchmarking ::MultiDoc . run ( :bulk_insert_small )
239
- end
240
-
241
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called LARGE_DOC.json.
242
- task :bulk_insert_large do
243
- puts "MULTI DOCUMENT BENCHMARK:: BULK INSERT LARGE"
244
- Mongo ::Benchmarking ::MultiDoc . run ( :bulk_insert_large )
245
- end
246
-
247
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called GRIDFS_LARGE.
248
- task :gridfs_upload do
249
- puts "MULTI DOCUMENT BENCHMARK:: GRIDFS UPLOAD"
250
- Mongo ::Benchmarking ::MultiDoc . run ( :gridfs_upload )
251
- end
252
-
253
- # Requirement: A file in Mongo::Benchmarking::DATA_PATH, called GRIDFS_LARGE.
254
- task :gridfs_download do
255
- puts "MULTI DOCUMENT BENCHMARK:: GRIDFS DOWNLOAD"
256
- Mongo ::Benchmarking ::MultiDoc . run ( :gridfs_download )
257
- end
258
- end
259
-
260
- namespace :parallel do
261
- desc "Run the common driver paralell ETL benchmarking tests"
262
-
263
- # Requirement: A directory in Mongo::Benchmarking::DATA_PATH, called LDJSON_MULTI,
264
- # with the files used in this task.
265
- task :import do
266
- puts "PARALLEL ETL BENCHMARK:: IMPORT"
267
- Mongo ::Benchmarking ::Parallel . run ( :import )
268
- end
269
-
270
- # Requirement: A directory in Mongo::Benchmarking::DATA_PATH, called LDJSON_MULTI,
271
- # with the files used in this task.
272
- # Requirement: Another directory in "#{Mongo::Benchmarking::DATA_PATH}/LDJSON_MULTI"
273
- # called 'output'.
274
- task :export do
275
- puts "PARALLEL ETL BENCHMARK:: EXPORT"
276
- Mongo ::Benchmarking ::Parallel . run ( :export )
277
- end
278
-
279
- # Requirement: A directory in Mongo::Benchmarking::DATA_PATH, called GRIDFS_MULTI,
280
- # with the files used in this task.
281
- task :gridfs_upload do
282
- puts "PARALLEL ETL BENCHMARK:: GRIDFS UPLOAD"
283
- Mongo ::Benchmarking ::Parallel . run ( :gridfs_upload )
284
- end
285
-
286
- # Requirement: A directory in Mongo::Benchmarking::DATA_PATH, called GRIDFS_MULTI,
287
- # with the files used in this task.
288
- # Requirement: Another directory in "#{Mongo::Benchmarking::DATA_PATH}/GRIDFS_MULTI"
289
- # called 'output'.
290
- task :gridfs_download do
291
- puts "PARALLEL ETL BENCHMARK:: GRIDFS DOWNLOAD"
292
- Mongo ::Benchmarking ::Parallel . run ( :gridfs_download )
293
- end
294
- end
295
- end
134
+ load 'profile/benchmarking/rake/tasks.rake'
0 commit comments