summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml1
-rw-r--r--jstests/auth/commands_builtin_roles.js1
-rw-r--r--jstests/auth/commands_user_defined_roles.js1
-rw-r--r--jstests/auth/lib/commands_lib.js28
-rw-r--r--jstests/core/indexStatsCommand.js90
-rw-r--r--jstests/slow2/sharding_jscore_passthrough.js1
-rw-r--r--src/mongo/db/auth/action_types.txt1
-rw-r--r--src/mongo/db/auth/role_graph_builtin_roles.cpp4
-rw-r--r--src/mongo/db/server_options.h3
-rw-r--r--src/mongo/db/server_options_helpers.cpp12
-rw-r--r--src/mongo/shell/collection.js127
11 files changed, 3 insertions, 266 deletions
diff --git a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
index f8be3b651d0..78012fdceff 100644
--- a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
+++ b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
@@ -39,7 +39,6 @@ selector:
- jstests/core/bench_test*.js
- jstests/core/mr_replaceIntoDB.js
- jstests/core/queryoptimizera.js
- - jstests/core/indexStatsCommand.js
- jstests/core/storageDetailsCommand.js
- jstests/core/stages*.js
- jstests/core/top.js
diff --git a/jstests/auth/commands_builtin_roles.js b/jstests/auth/commands_builtin_roles.js
index 733600e521b..80ba2c981c7 100644
--- a/jstests/auth/commands_builtin_roles.js
+++ b/jstests/auth/commands_builtin_roles.js
@@ -146,7 +146,6 @@ function checkForNonExistentRoles() {
var opts = {
auth:"",
- enableExperimentalIndexStatsCmd: "",
enableExperimentalStorageDetailsCmd: ""
}
var impls = {
diff --git a/jstests/auth/commands_user_defined_roles.js b/jstests/auth/commands_user_defined_roles.js
index facf097ea61..760dabaa6ea 100644
--- a/jstests/auth/commands_user_defined_roles.js
+++ b/jstests/auth/commands_user_defined_roles.js
@@ -178,7 +178,6 @@ function createUsers(conn) {
var opts = {
auth:"",
- enableExperimentalIndexStatsCmd: "",
enableExperimentalStorageDetailsCmd: ""
}
var impls = {
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js
index 7189ba346f9..18ccb128e58 100644
--- a/jstests/auth/lib/commands_lib.js
+++ b/jstests/auth/lib/commands_lib.js
@@ -1440,34 +1440,6 @@ var authCommandsLib = {
}
]
},
-/* temporarily removed see SERVER-13555
- {
- testname: "indexStats",
- command: {indexStats: "x", index: "a_1"},
- skipSharded: true,
- setup: function (db) {
- db.x.save({a: 10});
- db.x.ensureIndex({a: 1});
- },
- teardown: function (db) { db.x.drop(); },
- testcases: [
- {
- runOnDb: firstDbName,
- roles: roles_dbAdmin,
- privileges: [
- { resource: {db: firstDbName, collection: "x"}, actions: ["indexStats"] }
- ]
- },
- {
- runOnDb: secondDbName,
- roles: roles_dbAdminAny,
- privileges: [
- { resource: {db: secondDbName, collection: "x"}, actions: ["indexStats"] }
- ]
- }
- ]
- },
-*/
{
testname: "isMaster",
command: {isMaster: 1},
diff --git a/jstests/core/indexStatsCommand.js b/jstests/core/indexStatsCommand.js
deleted file mode 100644
index 375d17398b6..00000000000
--- a/jstests/core/indexStatsCommand.js
+++ /dev/null
@@ -1,90 +0,0 @@
-db.indexStatsCommand.drop();
-db.createCollection("indexStatsCommand");
-
-t = db.indexStatsCommand;
-
-var COMMAND_NOT_FOUND_CODE = 59;
-
-for (var i = 0; i < 3000; ++i) {
- t.insert({i: i, d: i % 13});
-}
-
-function textWithIndexVersion(version) {
- var indexName = 'test_d_' + version;
- t.ensureIndex({d: 1}, {v: version, name: indexName});
-
- var result = t.indexStats({index: indexName});
- if (result["code"] === COMMAND_NOT_FOUND_CODE) {
- print("storageDetails command not available: skipping");
- return;
- }
-
- assert.commandWorked(result);
-
- assert(result.index === indexName);
- assert(result.isIdIndex === false);
- assert(isObject(result.keyPattern));
- assert.neq(result.keyPattern, null);
- assert(isString(result.storageNs));
- assert(isNumber(result.bucketBodyBytes));
- assert.eq(result.depth, 1);
- assert(isObject(result.overall));
- assert.neq(result.overall, null);
-
- function checkStats(data) {
- assert(data.count instanceof NumberLong);
- assert(isNumber(data.mean));
- assert(isNumber(data.stddev));
- assert(isNumber(data.min));
- assert(isNumber(data.max));
- }
-
- function checkAreaStats(data) {
- assert(isNumber(data.numBuckets));
-
- assert(isObject(data.keyCount));
- assert.neq(data.keyCount, null);
- checkStats(data.keyCount);
-
- assert(isObject(data.usedKeyCount));
- assert.neq(data.usedKeyCount, null);
- checkStats(data.usedKeyCount);
-
- assert(isObject(data.bsonRatio));
- assert.neq(data.bsonRatio, null);
- checkStats(data.bsonRatio);
-
- assert(isObject(data.keyNodeRatio));
- assert.neq(data.keyNodeRatio, null);
- checkStats(data.keyNodeRatio);
-
- assert(isObject(data.fillRatio));
- assert.neq(data.fillRatio, null);
- checkStats(data.fillRatio);
- }
-
- assert(isObject(result.overall));
- checkAreaStats(result.overall);
-
- assert(result.perLevel instanceof Array);
- for (var i = 0; i < result.perLevel.length; ++i) {
- assert(isObject(result.perLevel[i]));
- checkAreaStats(result.perLevel[i]);
- }
-
- result = t.indexStats();
- assert.commandFailed(result);
- assert(result.errmsg.match(/index name is required/));
-
- result = t.indexStats({index: "nonexistent"})
- assert.commandFailed(result);
- assert(result.errmsg.match(/index does not exist/));
-
- result = t.indexStats({index: "_id_", expandNodes: ['string']})
- assert.commandFailed(result);
- assert(result.errmsg.match(/expandNodes.*numbers/));
-
- t.dropIndex(indexName);
-}
-
-[0, 1].map(textWithIndexVersion);
diff --git a/jstests/slow2/sharding_jscore_passthrough.js b/jstests/slow2/sharding_jscore_passthrough.js
index dd05d941dc8..dfb9ac5e1bd 100644
--- a/jstests/slow2/sharding_jscore_passthrough.js
+++ b/jstests/slow2/sharding_jscore_passthrough.js
@@ -130,7 +130,6 @@ var db;
'mr_replaceIntoDB|' +
'mr_auth|' +
'queryoptimizera|' +
- 'indexStatsCommand|' +
'storageDetailsCommand|' +
'reversecursor|' +
'stages.*|' +
diff --git a/src/mongo/db/auth/action_types.txt b/src/mongo/db/auth/action_types.txt
index f6c9164b1e8..be9cee2f0d2 100644
--- a/src/mongo/db/auth/action_types.txt
+++ b/src/mongo/db/auth/action_types.txt
@@ -58,7 +58,6 @@
"grantRolesToUser", # Not used for permissions checks, but to id the event in logs.
"hostInfo",
"impersonate",
-"indexStats",
"inprog",
"insert",
"internal", # Special action type that represents internal actions
diff --git a/src/mongo/db/auth/role_graph_builtin_roles.cpp b/src/mongo/db/auth/role_graph_builtin_roles.cpp
index 213aa690b4a..2e143e4a919 100644
--- a/src/mongo/db/auth/role_graph_builtin_roles.cpp
+++ b/src/mongo/db/auth/role_graph_builtin_roles.cpp
@@ -140,8 +140,8 @@ MONGO_INITIALIZER(AuthorizationBuiltinRoles)(InitializerContext* context) {
<< ActionType::dropCollection
<< ActionType::dropDatabase // clusterAdmin gets this also TODO(spencer): should
// readWriteAnyDatabase?
- << ActionType::dropIndex << ActionType::createIndex << ActionType::indexStats
- << ActionType::enableProfiler << ActionType::listCollections << ActionType::listIndexes
+ << ActionType::dropIndex << ActionType::createIndex << ActionType::enableProfiler
+ << ActionType::listCollections << ActionType::listIndexes
<< ActionType::planCacheIndexFilter << ActionType::planCacheRead
<< ActionType::planCacheWrite << ActionType::reIndex
<< ActionType::renameCollectionSameDB // read_write gets this also
diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h
index eb51098823c..268ecd86870 100644
--- a/src/mongo/db/server_options.h
+++ b/src/mongo/db/server_options.h
@@ -117,8 +117,7 @@ struct ServerGlobalParams {
* Switches to enable experimental (unsupported) features.
*/
struct ExperimentalFeatures {
- ExperimentalFeatures() : indexStatsCmdEnabled(false), storageDetailsCmdEnabled(false) {}
- bool indexStatsCmdEnabled; // -- enableExperimentalIndexStatsCmd
+ ExperimentalFeatures() : storageDetailsCmdEnabled(false) {}
bool storageDetailsCmdEnabled; // -- enableExperimentalStorageDetailsCmd
} experimental;
diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp
index 9833cf84541..0bd160a70be 100644
--- a/src/mongo/db/server_options_helpers.cpp
+++ b/src/mongo/db/server_options_helpers.cpp
@@ -363,14 +363,6 @@ Status addGeneralServerOptions(moe::OptionSection* options) {
moe::Switch,
"log stack traces for every exception").hidden();
- options->addOptionChaining("enableExperimentalIndexStatsCmd",
- "enableExperimentalIndexStatsCmd",
- moe::Switch,
- "EXPERIMENTAL (UNSUPPORTED). "
- "Enable command computing aggregate statistics on indexes.")
- .hidden()
- .setSources(moe::SourceAllLegacy);
-
options->addOptionChaining("enableExperimentalStorageDetailsCmd",
"enableExperimentalStorageDetailsCmd",
moe::Switch,
@@ -755,10 +747,6 @@ Status storeServerOptions(const moe::Environment& params, const std::vector<std:
}
}
- if (params.count("enableExperimentalIndexStatsCmd")) {
- serverGlobalParams.experimental.indexStatsCmdEnabled =
- params["enableExperimentalIndexStatsCmd"].as<bool>();
- }
if (params.count("enableExperimentalStorageDetailsCmd")) {
serverGlobalParams.experimental.storageDetailsCmdEnabled =
params["enableExperimentalStorageDetailsCmd"].as<bool>();
diff --git a/src/mongo/shell/collection.js b/src/mongo/shell/collection.js
index c36e2324657..1ef9ee3060c 100644
--- a/src/mongo/shell/collection.js
+++ b/src/mongo/shell/collection.js
@@ -56,7 +56,6 @@ DBCollection.prototype.help = function () {
print("\tdb." + shortName + ".getPlanCache() get query plan cache associated with collection");
print("\tdb." + shortName + ".getIndexes()");
print("\tdb." + shortName + ".group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )");
- // print("\tdb." + shortName + ".indexStats({expandNodes: [<expanded child numbers>}, <detailed: t/f>) - output aggregate/per-depth btree bucket stats");
print("\tdb." + shortName + ".insert(obj)");
print("\tdb." + shortName + ".mapReduce( mapFunction , reduceFunction , <optional params> )");
print("\tdb." + shortName + ".aggregate( [pipeline], <optional params> ) - performs an aggregation on a collection; returns a cursor");
@@ -73,7 +72,6 @@ DBCollection.prototype.help = function () {
print("\tdb." + shortName + ".totalSize() - storage allocated for all data and indexes");
print("\tdb." + shortName + ".update(query, object[, upsert_bool, multi_bool]) - instead of two flags, you can pass an object with fields: upsert, multi");
print("\tdb." + shortName + ".validate( <full> ) - SLOW");;
- // print("\tdb." + shortName + ".getIndexStats({expandNodes: [<expanded child numbers>}, <detailed: t/f>) - same as .indexStats but prints a human readable summary of the output");
print("\tdb." + shortName + ".getShardVersion() - only for use with sharding");
print("\tdb." + shortName + ".getShardDistribution() - prints statistics about data distribution in the cluster");
print("\tdb." + shortName + ".getSplitKeysForChunks( <maxChunkSize> ) - calculates split points over all chunks and returns splitter function");
@@ -879,131 +877,6 @@ DBCollection.prototype.getPagesInRAM = function(params) {
}
}
-DBCollection.prototype.indexStats = function(params) {
- var cmd = { indexStats: this.getName() };
-
- if (typeof(params) == 'object') // support arbitrary options here
- Object.extend(cmd, params);
-
- var res = this._db.runCommand(cmd);
- if (!res.ok && res.errmsg.match(/no such cmd/)) {
- print("this command requires starting mongod with --enableExperimentalIndexStatsCmd");
- }
- return res;
-}
-
-DBCollection.prototype.getIndexStats = function(params, detailed) {
- var stats = this.indexStats(params);
- if (!stats.ok) {
- print("error executing indexStats command: " + tojson(stats));
- return;
- }
-
- print("-- index \"" + stats.index + "\" --");
- print(" version " + stats.version + " | key pattern " +
- tojsononeline(stats.keyPattern) + (stats.isIdIndex ? " [id index]" : "") +
- " | storage namespace \"" + stats.storageNs + "\"");
- print(" " + stats.depth + " deep, bucket body is " + stats.bucketBodyBytes + " bytes");
- print();
- if (detailed) {
- print(" ** min |-- .02 quant --- 1st quartile [=== median ===] 3rd quartile --- " +
- ".98 quant --| max ** ");
- print();
- }
-
- // format a number rounding to three decimal figures
- var fnum = function(n) {
- return n.toFixed(3);
- }
-
- var formatBoxPlot = function(st) {
- var out = "";
- if (st.count == 0) return "no samples";
- out += "avg. " + fnum(st.mean);
- if (st.count == 1) return out;
- out += " | stdev. " + fnum(st.stddev);
-
- var quant = function(st, prob) {
- return st.quantiles["" + prob].toFixed(3);
- }
- if (st.quantiles) {
- out += "\t" + fnum(st.min) + " |-- " + quant(st, 0.02) + " --- " + quant(st, 0.25) +
- " [=== " + quant(st, 0.5) + " ===] " + quant(st, 0.75) + " --- " +
- quant(st, 0.98) + " --| " + fnum(st.max) + " ";
- }
- return out;
- }
-
- var formatStats = function(indent, nd) {
- var out = "";
- out += indent + "bucket count\t" + nd.numBuckets
- + "\ton average " + fnum(nd.fillRatio.mean * 100) + " %"
- + " (±" + fnum((nd.fillRatio.stddev) * 100) + " %) full"
- + "\t" + fnum(nd.bsonRatio.mean * 100) + " %"
- + " (±" + fnum((nd.bsonRatio.stddev) * 100) + " %) bson keys, "
- + fnum(nd.keyNodeRatio.mean * 100) + " %"
- + " (±" + fnum((nd.keyNodeRatio.stddev) * 100) + " %) key nodes\n";
- if (detailed) {
- out += indent + "\n";
- out += indent + "key count\t" + formatBoxPlot(nd.keyCount) + "\n";
- out += indent + "used keys\t" + formatBoxPlot(nd.usedKeyCount) + "\n";
- out += indent + "space occupied by (ratio of bucket)\n";
- out += indent + " key nodes\t" + formatBoxPlot(nd.keyNodeRatio) + "\n";
- out += indent + " key objs \t" + formatBoxPlot(nd.bsonRatio) + "\n";
- out += indent + " used \t" + formatBoxPlot(nd.fillRatio) + "\n";
- }
- return out;
- }
-
- print(formatStats(" ", stats.overall));
- print();
-
- for (var d = 0; d <= stats.depth; ++d) {
- print(" -- depth " + d + " --");
- print(formatStats(" ", stats.perLevel[d]));
- }
-
- if (stats.expandedNodes) {
- print("\n-- expanded nodes --\n");
- for (var d = 0; d < stats.expandedNodes.length - 1; ++d) {
- var node;
- if (d == 0) {
- node = stats.expandedNodes[0][0];
- print(" -- root -- ");
- } else {
- node = stats.expandedNodes[d][params.expandNodes[d]];
- print(" -- node # " + params.expandNodes[d] + " at depth " +
- node.nodeInfo.depth + " -- ");
- }
- print(" " + (node.nodeInfo.firstKey ? tojsononeline(node.nodeInfo.firstKey) : "") + " -> " +
- (node.nodeInfo.lastKey ? tojsononeline(node.nodeInfo.lastKey) : ""));
- print(" " + node.nodeInfo.keyCount + " keys (" + node.nodeInfo.keyCount + " used)" +
- "\tat diskloc " + tojsononeline(node.nodeInfo.diskLoc));
- print(" ");
- print(" subtree stats, excluding node");
- print(formatStats(" ", node));
-
- if (detailed) {
- print(" children (: % full, subtree % full)");
- var children = " ";
- for (var k = 0; k < stats.expandedNodes[d + 1].length; ++k) {
- var node = stats.expandedNodes[d + 1][k];
- if (node.nodeInfo != undefined) {
- children += node.nodeInfo.childNum + ": " +
- (node.nodeInfo.fillRatio * 100).toFixed(1) + ", " +
- (node.fillRatio.mean * 100).toFixed(1) + " | ";
- } else {
- children += k + ": - | ";
- }
- if (k != 0 && k % 5 == 0) children += "\n ";
- }
- print(children);
- print(" ");
- }
- }
- }
-}
-
DBCollection.prototype.getShardVersion = function(){
return this._db._adminCommand( { getShardVersion : this._fullName } );
}