summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2019-06-17 15:47:18 +0100
committerAnton Korshunov <anton.korshunov@mongodb.com>2019-06-19 17:08:11 +0100
commit46e086d2093798cdec949eba2919ccac88719166 (patch)
tree65a3be4c30cfbb7984277d1acc30d5834c4b29c6 /src
parentc5eaeddb0f0273c5843d0ca3d742970c45749d0c (diff)
downloadmongo-46e086d2093798cdec949eba2919ccac88719166.tar.gz
SERVER-33967 Include executionTimeMillis for each shard in the explain output
Diffstat (limited to 'src')
-rw-r--r--src/mongo/s/commands/cluster_explain.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/mongo/s/commands/cluster_explain.cpp b/src/mongo/s/commands/cluster_explain.cpp
index d814f6080d9..fb3b748f4c5 100644
--- a/src/mongo/s/commands/cluster_explain.cpp
+++ b/src/mongo/s/commands/cluster_explain.cpp
@@ -304,25 +304,10 @@ void ClusterExplain::buildExecStats(const vector<Strategy::CommandResult>& shard
BSONArrayBuilder execShardsBuilder(executionStagesBob.subarrayStart("shards"));
for (size_t i = 0; i < shardResults.size(); i++) {
BSONObjBuilder singleShardBob(execShardsBuilder.subobjStart());
-
BSONObj execStats = shardResults[i].result["executionStats"].Obj();
- BSONObj execStages = execStats["executionStages"].Obj();
singleShardBob.append("shardName", shardResults[i].shardTargetId.toString());
-
- // Append error-related fields, if present.
- if (!execStats["executionSuccess"].eoo()) {
- singleShardBob.append(execStats["executionSuccess"]);
- }
- if (!execStats["errorMessage"].eoo()) {
- singleShardBob.append(execStats["errorMessage"]);
- }
- if (!execStats["errorCode"].eoo()) {
- singleShardBob.append(execStats["errorCode"]);
- }
-
- appendIfRoom(&singleShardBob, execStages, "executionStages");
-
+ appendElementsIfRoom(&singleShardBob, execStats);
singleShardBob.doneFast();
}
execShardsBuilder.doneFast();