summaryrefslogtreecommitdiff
path: root/jstests/core/profile_getmore.js
diff options
context:
space:
mode:
authorMihai Andrei <mihai.andrei@10gen.com>2021-03-24 20:15:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-24 20:55:46 +0000
commit358e73ebc88a1656a71acc5caa737a01d8f2cc5f (patch)
treef67fc759d7f1783a23da5d11775acc4335479f29 /jstests/core/profile_getmore.js
parent13eb79b565789fc5829a3ced8f39ce4e1ac62619 (diff)
downloadmongo-358e73ebc88a1656a71acc5caa737a01d8f2cc5f.tar.gz
SERVER-54840 [SBE] Allow SBE getMores to generate execStats for profiler entries
Diffstat (limited to 'jstests/core/profile_getmore.js')
-rw-r--r--jstests/core/profile_getmore.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/jstests/core/profile_getmore.js b/jstests/core/profile_getmore.js
index fbf838fff05..89c545c40e4 100644
--- a/jstests/core/profile_getmore.js
+++ b/jstests/core/profile_getmore.js
@@ -2,7 +2,6 @@
// does_not_support_stepdowns,
// requires_getmore,
// requires_profiling,
-// sbe_incompatible,
// ]
// Confirms that profiled getMore execution contains all expected metrics with proper values.
@@ -12,30 +11,30 @@
load("jstests/libs/profiler.js"); // For getLatestProfilerEntry.
-var testDB = db.getSiblingDB("profile_getmore");
+const testDB = db.getSiblingDB("profile_getmore");
assert.commandWorked(testDB.dropDatabase());
-var coll = testDB.getCollection("test");
+const coll = testDB.getCollection("test");
testDB.setProfilingLevel(2);
+let i;
//
// Confirm basic metrics on getMore with a not-exhausted cursor.
//
-var i;
for (i = 0; i < 10; ++i) {
assert.commandWorked(coll.insert({a: i}));
}
assert.commandWorked(coll.createIndex({a: 1}));
-var cursor = coll.find({a: {$gt: 0}}).sort({a: 1}).batchSize(2);
+let cursor = coll.find({a: {$gt: 0}}).sort({a: 1}).batchSize(2);
cursor.next(); // Perform initial query and consume first of 2 docs returned.
-var cursorId = getLatestProfilerEntry(testDB, {op: "query"}).cursorid; // Save cursorid from find.
+let cursorId = getLatestProfilerEntry(testDB, {op: "query"}).cursorid; // Save cursorid from find.
cursor.next(); // Consume second of 2 docs from initial query.
cursor.next(); // getMore performed, leaving open cursor.
-var profileObj = getLatestProfilerEntry(testDB, {op: "getmore"});
+let profileObj = getLatestProfilerEntry(testDB, {op: "getmore"});
assert.eq(profileObj.ns, coll.getFullName(), tojson(profileObj));
assert.eq(profileObj.op, "getmore", tojson(profileObj));
@@ -105,8 +104,8 @@ for (i = 0; i < 20; ++i) {
}
assert.commandWorked(coll.createIndex({a: 1}));
-var cursor = coll.aggregate([{$match: {a: {$gte: 0}}}], {cursor: {batchSize: 0}, hint: {a: 1}});
-var cursorId = getLatestProfilerEntry(testDB, {"command.aggregate": coll.getName()}).cursorid;
+cursor = coll.aggregate([{$match: {a: {$gte: 0}}}], {cursor: {batchSize: 0}, hint: {a: 1}});
+cursorId = getLatestProfilerEntry(testDB, {"command.aggregate": coll.getName()}).cursorid;
assert.neq(0, cursorId);
cursor.next(); // Consume the result set.