summaryrefslogtreecommitdiff
path: root/src/mongo/db/introspect.cpp
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2020-10-14 12:04:14 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-14 22:23:55 +0000
commit7770f90b6c12e0e1e13d01f69b3890cbf0832fae (patch)
tree1295cfa62f04aedc90843e92f7ae1c74305c5a0f /src/mongo/db/introspect.cpp
parent6e2ad2316a0603f5d6c03e69670ca4f95861ad3b (diff)
downloadmongo-7770f90b6c12e0e1e13d01f69b3890cbf0832fae.tar.gz
SERVER-51023 Collect document bytes read for operation resource consumption metrics
Diffstat (limited to 'src/mongo/db/introspect.cpp')
-rw-r--r--src/mongo/db/introspect.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index e3d71695a9b..307723838fd 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -69,11 +69,10 @@ void profile(OperationContext* opCtx, NetworkOp op) {
}
auto& metricsCollector = ResourceConsumption::MetricsCollector::get(opCtx);
- if (ResourceConsumption::isMetricsCollectionEnabled() &&
- !metricsCollector.getDbName().empty()) {
+ if (metricsCollector.hasCollectedMetrics()) {
BSONObjBuilder metricsBuilder = b.subobjStart("operationMetrics");
const auto& metrics = metricsCollector.getMetrics();
- metrics.toBson(&metricsBuilder);
+ metrics.toFlatBsonAllFields(&metricsBuilder);
metricsBuilder.done();
}