diff options
author | David Storch <david.storch@10gen.com> | 2018-08-15 13:38:08 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2018-08-21 18:54:22 -0400 |
commit | 21762f8b9b8c64fd32bed173eb74e2172088e21b (patch) | |
tree | 6ad4fef6ca4a2e303bfc6aacb55b03b77d268417 /jstests/auth | |
parent | e2f47a13f11d5a4aa2b7f23e1e0c157d90435e9e (diff) | |
download | mongo-21762f8b9b8c64fd32bed173eb74e2172088e21b.tar.gz |
SERVER-36528 Implement $planCacheStats agg source.
The $planCacheStats agg metadata source should typically be used
instead of the older 'planCacheListPlans' and
'planCacheListQueryShapes' commands (although these plan cache
commands are still fully supported).
Lookup by 'queryHash' can be achieved via a $planCacheStats-$match
pipeline.
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/lib/commands_lib.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 1ef33169fdb..97b010062d6 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -1168,6 +1168,31 @@ var authCommandsLib = { ] }, { + testname: "aggregate_planCacheStats", + command: {aggregate: "foo", pipeline: [{$planCacheStats: {}}], cursor: {}}, + skipSharded: true, + setup: function(db) { + db.createCollection("foo"); + }, + teardown: function(db) { + db.foo.drop(); + }, + testcases: [ + { + runOnDb: firstDbName, + roles: roles_readDbAdmin, + privileges: + [{resource: {db: firstDbName, collection: "foo"}, actions: ["planCacheRead"]}], + }, + { + runOnDb: secondDbName, + roles: roles_readDbAdminAny, + privileges: + [{resource: {db: secondDbName, collection: "foo"}, actions: ["planCacheRead"]}], + }, + ] + }, + { testname: "aggregate_currentOp_allUsers_true", command: {aggregate: 1, pipeline: [{$currentOp: {allUsers: true}}], cursor: {}}, testcases: [ |