File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
test/benchmarks/mongoBench/suites Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,30 @@ const {
1313
1414function makeSingleBench ( suite ) {
1515 suite
16+ . benchmark ( 'returnDocument' , benchmark =>
17+ benchmark
18+ . taskSize ( 1.531e-3 ) // One tweet is 1,531 bytes or 0.001531 MB
19+ . setup ( makeLoadJSON ( 'tweet.json' ) )
20+ . task ( async function ( ) {
21+ return this . doc ;
22+ } )
23+ )
24+ . benchmark ( 'ping' , benchmark =>
25+ benchmark
26+ . taskSize ( 0.15 ) // { ping: 1 } is 15 bytes of BSON x 10,000 iterations
27+ . setup ( makeClient )
28+ . setup ( connectClient )
29+ . setup ( initDb )
30+ . task ( async function ( ) {
31+ for ( let i = 0 ; i < 10000 ; ++ i ) {
32+ await this . db . command ( { ping : 1 } ) ;
33+ }
34+ } )
35+ . teardown ( disconnectClient )
36+ )
1637 . benchmark ( 'runCommand' , benchmark =>
1738 benchmark
39+ // { hello: true } is 13 bytes. However the legacy hello was 16 bytes, to preserve history comparison data we leave this value as is.
1840 . taskSize ( 0.16 )
1941 . setup ( makeClient )
2042 . setup ( connectClient )
You can’t perform that action at this time.
0 commit comments