summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/find.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/query/find.cpp
parent6e2ad2316a0603f5d6c03e69670ca4f95861ad3b (diff)
downloadmongo-7770f90b6c12e0e1e13d01f69b3890cbf0832fae.tar.gz
SERVER-51023 Collect document bytes read for operation resource consumption metrics
Diffstat (limited to 'src/mongo/db/query/find.cpp')
-rw-r--r--src/mongo/db/query/find.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index eee9ce240cd..9403b21e1e3 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -232,11 +232,7 @@ Message getMore(OperationContext* opCtx,
const NamespaceString nss(ns);
- ResourceConsumption::ScopedMetricsCollector scopedMetrics(opCtx);
- if (ResourceConsumption::shouldCollectMetricsForDatabase(nss.db())) {
- auto& opMetrics = ResourceConsumption::MetricsCollector::get(opCtx);
- opMetrics.setDbName(nss.db().toString());
- }
+ ResourceConsumption::ScopedMetricsCollector scopedMetrics(opCtx, nss.db().toString());
// Cursors come in one of two flavors:
//
@@ -580,11 +576,7 @@ bool runQuery(OperationContext* opCtx,
nss.isValid());
invariant(!nss.isCommand());
- ResourceConsumption::ScopedMetricsCollector scopedMetrics(opCtx);
- if (ResourceConsumption::shouldCollectMetricsForDatabase(nss.db())) {
- auto& opMetrics = ResourceConsumption::MetricsCollector::get(opCtx);
- opMetrics.setDbName(nss.db().toString());
- }
+ ResourceConsumption::ScopedMetricsCollector scopedMetrics(opCtx, nss.db().toString());
// Set CurOp information.
const auto upconvertedQuery = upconvertQueryEntry(q.query, nss, q.ntoreturn, q.ntoskip);