summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils.cpp
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2019-05-16 14:48:19 -0400
committerA. Jesse Jiryu Davis <jesse@mongodb.com>2019-05-21 16:35:25 -0400
commitf30e70b5d1ebae87f373de108314993e58309739 (patch)
tree97b5f921d9329cd573fc76d536105c50196d04d2 /src/mongo/shell/shell_utils.cpp
parentdb55694f289d99db4f808a44643130818f3048a4 (diff)
downloadmongo-f30e70b5d1ebae87f373de108314993e58309739.tar.gz
SERVER-36099 Trim FTDC connection pool stats
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r--src/mongo/shell/shell_utils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp
index 02fa51ed004..c26941d02de 100644
--- a/src/mongo/shell/shell_utils.cpp
+++ b/src/mongo/shell/shell_utils.cpp
@@ -310,7 +310,8 @@ BSONObj replMonitorStats(const BSONObj& a, void* data) {
"replMonitorStats requires a single string argument (the ReplSet name)",
a.nFields() == 1 && a.firstElement().type() == String);
- ReplicaSetMonitorPtr rsm = ReplicaSetMonitor::get(a.firstElement().valuestrsafe());
+ auto name = a.firstElement().valuestrsafe();
+ ReplicaSetMonitorPtr rsm = ReplicaSetMonitor::get(name);
if (!rsm) {
return BSON(""
<< "no ReplSetMonitor exists by that name");
@@ -318,7 +319,8 @@ BSONObj replMonitorStats(const BSONObj& a, void* data) {
BSONObjBuilder result;
rsm->appendInfo(result);
- return result.obj();
+ // Stats are like {replSetName: {hosts: [{ ... }, { ... }]}}.
+ return result.obj()[name].Obj().getOwned();
}
BSONObj useWriteCommandsDefault(const BSONObj& a, void* data) {