diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-04-27 11:15:10 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-05-02 11:16:16 -0400 |
commit | 4767529bec1ddf2757930c1f140845222c597c28 (patch) | |
tree | 2725fdd61aaa144125d9b8ee18d786f0f84c13bc /jstests/core | |
parent | c52c530428fbbe0cae1293ad6605c3ab7be2a281 (diff) | |
download | mongo-4767529bec1ddf2757930c1f140845222c597c28.tar.gz |
SERVER-23264 Add execStats to profiler for all relevant ops/commands
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/profile_agg.js | 3 | ||||
-rw-r--r-- | jstests/core/profile_count.js | 3 | ||||
-rw-r--r-- | jstests/core/profile_delete.js | 2 | ||||
-rw-r--r-- | jstests/core/profile_distinct.js | 2 | ||||
-rw-r--r-- | jstests/core/profile_find.js | 3 | ||||
-rw-r--r-- | jstests/core/profile_findandmodify.js | 3 | ||||
-rw-r--r-- | jstests/core/profile_geonear.js | 3 | ||||
-rw-r--r-- | jstests/core/profile_getmore.js | 2 | ||||
-rw-r--r-- | jstests/core/profile_group.js | 2 | ||||
-rw-r--r-- | jstests/core/profile_mapreduce.js | 1 | ||||
-rw-r--r-- | jstests/core/profile_update.js | 4 |
11 files changed, 16 insertions, 12 deletions
diff --git a/jstests/core/profile_agg.js b/jstests/core/profile_agg.js index a0e89b13f8f..c61b0130689 100644 --- a/jstests/core/profile_agg.js +++ b/jstests/core/profile_agg.js @@ -1,6 +1,5 @@ // Confirms that profiled aggregation execution contains all expected metrics with proper values. // TODO SERVER-23265: Fix keysExamined, docsExamined & hasSortStage. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -35,7 +34,7 @@ assert.eq(profileObj.docsExamined, 0, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); - + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(profileObj.command.aggregate, coll.getName(), tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); diff --git a/jstests/core/profile_count.js b/jstests/core/profile_count.js index 071468e631f..09ba6520828 100644 --- a/jstests/core/profile_count.js +++ b/jstests/core/profile_count.js @@ -1,5 +1,4 @@ // Confirms that profiled count execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -31,6 +30,7 @@ assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(profileObj.command.count, coll.getName(), tojson(profileObj)); assert.eq(profileObj.planSummary, "COUNT", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); assert(profileObj.hasOwnProperty("millis"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); @@ -71,6 +71,7 @@ assert.eq(profileObj.command.query, query, tojson(profileObj)); assert.eq(profileObj.keysExamined, 6, tojson(profileObj)); assert.eq(profileObj.planSummary, "COUNT_SCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); // // Confirm "fromMultiPlanner" metric. diff --git a/jstests/core/profile_delete.js b/jstests/core/profile_delete.js index 0e8b2994cd6..b5906addd9b 100644 --- a/jstests/core/profile_delete.js +++ b/jstests/core/profile_delete.js @@ -1,5 +1,4 @@ // Confirms that profiled delete execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -33,6 +32,7 @@ assert.eq(profileObj.docsExamined, 1, tojson(profileObj)); assert.eq(profileObj.keysDeleted, 2, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert(profileObj.hasOwnProperty("millis"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); assert(profileObj.hasOwnProperty("locks"), tojson(profileObj)); diff --git a/jstests/core/profile_distinct.js b/jstests/core/profile_distinct.js index f3359f1e61d..0549b181b7a 100644 --- a/jstests/core/profile_distinct.js +++ b/jstests/core/profile_distinct.js @@ -1,5 +1,4 @@ // Confirms that profiled distinct execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -31,6 +30,7 @@ assert.eq(profileObj.keysExamined, 5, tojson(profileObj)); assert.eq(profileObj.docsExamined, 5, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { b: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(coll.getName(), profileObj.command.distinct, tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); diff --git a/jstests/core/profile_find.js b/jstests/core/profile_find.js index 5df83c38e77..c9a6d7bed8c 100644 --- a/jstests/core/profile_find.js +++ b/jstests/core/profile_find.js @@ -33,6 +33,7 @@ assert.eq(profileObj.docsExamined, 1, tojson(profileObj)); assert.eq(profileObj.nreturned, 1, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert.eq(profileObj.query.filter, {a: 1}, tojson(profileObj)); if (isLegacyReadMode) { assert.eq(profileObj.query.ntoreturn, -1, tojson(profileObj)); @@ -43,8 +44,6 @@ } assert.eq(profileObj.cursorExhausted, true, tojson(profileObj)); assert(!profileObj.hasOwnProperty("cursorid"), tojson(profileObj)); - assert.eq("IXSCAN", profileObj.execStats.inputStage.inputStage.stage, tojson(profileObj)); - assert.eq("LIMIT", profileObj.execStats.stage, tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); assert(profileObj.hasOwnProperty("millis"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); diff --git a/jstests/core/profile_findandmodify.js b/jstests/core/profile_findandmodify.js index 01c3303aafe..91ea534cf6d 100644 --- a/jstests/core/profile_findandmodify.js +++ b/jstests/core/profile_findandmodify.js @@ -1,5 +1,4 @@ // Confirms that profiled findAndModify execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -37,6 +36,7 @@ assert.eq(profileObj.keysInserted, 1, tojson(profileObj)); assert.eq(profileObj.keysDeleted, 1, tojson(profileObj)); assert.eq(profileObj.planSummary, "COLLSCAN", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); @@ -60,6 +60,7 @@ assert.eq(profileObj.ndeleted, 1, tojson(profileObj)); assert.eq(profileObj.keysDeleted, 1, tojson(profileObj)); assert.eq(profileObj.planSummary, "COLLSCAN", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); // // Update with {upsert: true} as findAndModify. diff --git a/jstests/core/profile_geonear.js b/jstests/core/profile_geonear.js index 715904a98fa..93d11b8ba48 100644 --- a/jstests/core/profile_geonear.js +++ b/jstests/core/profile_geonear.js @@ -1,5 +1,4 @@ // Confirms that profiled geonear execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -34,6 +33,8 @@ assert.eq(profileObj.docsExamined, 10, tojson(profileObj)); assert.eq( profileObj.planSummary, "GEO_NEAR_2DSPHERE { loc: \"2dsphere\" }", tojson(profileObj)); + assert.eq( + profileObj.execStats, {"$msg": "query not recording (too large)"}, tojson(profileObj)); assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(coll.getName(), profileObj.command.geoNear, tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); diff --git a/jstests/core/profile_getmore.js b/jstests/core/profile_getmore.js index bcc466415a1..7a6e9902d26 100644 --- a/jstests/core/profile_getmore.js +++ b/jstests/core/profile_getmore.js @@ -1,5 +1,4 @@ // Confirms that profiled getMore execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -39,6 +38,7 @@ assert.eq(profileObj.nreturned, 2, tojson(profileObj)); assert.eq(profileObj.query.batchSize, 2, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); assert(profileObj.hasOwnProperty("locks"), tojson(profileObj)); diff --git a/jstests/core/profile_group.js b/jstests/core/profile_group.js index 7b107329e49..a6942f05886 100644 --- a/jstests/core/profile_group.js +++ b/jstests/core/profile_group.js @@ -1,5 +1,4 @@ // Confirms that profiled group execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -31,6 +30,7 @@ assert.eq(profileObj.keysExamined, 2, tojson(profileObj)); assert.eq(profileObj.docsExamined, 2, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { b: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(profileObj.command.group.key, {a: 1, b: 1}, tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); diff --git a/jstests/core/profile_mapreduce.js b/jstests/core/profile_mapreduce.js index 5ecdff262d7..f2bb37480e2 100644 --- a/jstests/core/profile_mapreduce.js +++ b/jstests/core/profile_mapreduce.js @@ -39,6 +39,7 @@ assert.eq(profileObj.keysExamined, 3, tojson(profileObj)); assert.eq(profileObj.docsExamined, 3, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert.eq(profileObj.protocol, getProfilerProtocolStringForCommand(conn), tojson(profileObj)); assert.eq(coll.getName(), profileObj.command.mapreduce, tojson(profileObj)); assert(profileObj.hasOwnProperty("responseLength"), tojson(profileObj)); diff --git a/jstests/core/profile_update.js b/jstests/core/profile_update.js index bf0841fd267..215a8942d9c 100644 --- a/jstests/core/profile_update.js +++ b/jstests/core/profile_update.js @@ -1,5 +1,4 @@ // Confirms that profiled update execution contains all expected metrics with proper values. -// TODO SERVER-23264: Add execStats. (function() { "use strict"; @@ -35,6 +34,7 @@ assert.eq(profileObj.nMatched, 1, tojson(profileObj)); assert.eq(profileObj.nModified, 1, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); assert(profileObj.hasOwnProperty("millis"), tojson(profileObj)); assert(profileObj.hasOwnProperty("numYield"), tojson(profileObj)); assert(profileObj.hasOwnProperty("locks"), tojson(profileObj)); @@ -58,6 +58,7 @@ assert.eq(profileObj.nMatched, 5, tojson(profileObj)); assert.eq(profileObj.nModified, 5, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { a: 1.0 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); // // Confirm metrics for insert on update with "upsert: true". @@ -80,6 +81,7 @@ assert.eq(profileObj.nModified, 0, tojson(profileObj)); assert.eq(profileObj.upsert, true, tojson(profileObj)); assert.eq(profileObj.planSummary, "IXSCAN { _id: 1 }", tojson(profileObj)); + assert(profileObj.execStats.hasOwnProperty("stage"), tojson(profileObj)); // // Confirm 'nmoved' for MMAPv1. |