Skip to content

Commit 3049dd3

Browse files
committed
chore: add ping benchmark
1 parent b8de3b2 commit 3049dd3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/benchmarks/mongoBench/suites/singleBench.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,22 @@ function makeSingleBench(suite) {
2121
return this.doc;
2222
})
2323
)
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+
)
2437
.benchmark('runCommand', benchmark =>
2538
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.
2640
.taskSize(0.16)
2741
.setup(makeClient)
2842
.setup(connectClient)

0 commit comments

Comments
 (0)