diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-10-14 12:04:14 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-14 22:23:55 +0000 |
commit | 7770f90b6c12e0e1e13d01f69b3890cbf0832fae (patch) | |
tree | 1295cfa62f04aedc90843e92f7ae1c74305c5a0f /src/mongo/db/query/find.cpp | |
parent | 6e2ad2316a0603f5d6c03e69670ca4f95861ad3b (diff) | |
download | mongo-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.cpp | 12 |
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); |