diff options
author | Davis Haupt <davis.haupt@mongodb.com> | 2023-02-03 14:50:33 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-03 16:24:57 +0000 |
commit | 2b850f64ef4bbe8b033c0bb7420ebc922ac970a0 (patch) | |
tree | 072e8c685f1755ee3208c80f1522079c32fd403e /src/mongo/s/commands/cluster_find_cmd.h | |
parent | a6a6f59fd85a783da08a12aefd0fec4907225cf4 (diff) | |
download | mongo-2b850f64ef4bbe8b033c0bb7420ebc922ac970a0.tar.gz |
SERVER-73407 Collect telemetry on mongos for find and agg
Diffstat (limited to 'src/mongo/s/commands/cluster_find_cmd.h')
-rw-r--r-- | src/mongo/s/commands/cluster_find_cmd.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/s/commands/cluster_find_cmd.h b/src/mongo/s/commands/cluster_find_cmd.h index 360b2e6ce1b..52b1149e0fe 100644 --- a/src/mongo/s/commands/cluster_find_cmd.h +++ b/src/mongo/s/commands/cluster_find_cmd.h @@ -38,6 +38,7 @@ #include "mongo/db/fle_crud.h" #include "mongo/db/matcher/extensions_callback_noop.h" #include "mongo/db/query/cursor_response.h" +#include "mongo/db/query/telemetry.h" #include "mongo/db/stats/counters.h" #include "mongo/db/views/resolved_view.h" #include "mongo/rpc/get_status_from_command_result.h" @@ -224,6 +225,10 @@ public: ExtensionsCallbackNoop(), MatchExpressionParser::kAllowAllSpecialFeatures)); + if (!_didDoFLERewrite) { + telemetry::registerFindRequest(cq->getFindCommandRequest(), cq->nss(), opCtx); + } + try { // Do the work to generate the first batch of results. This blocks waiting to get // responses from the shard(s). @@ -245,6 +250,7 @@ public: } firstBatch.setPartialResultsReturned(partialResultsReturned); firstBatch.done(cursorId, cq->nss()); + telemetry::recordExecution(opCtx, _didDoFLERewrite); } catch (const ExceptionFor<ErrorCodes::CommandOnShardedViewNotSupportedOnMongod>& ex) { result->reset(); @@ -277,7 +283,7 @@ public: * were supplied with the command, and sets the constant runtime values that will be * forwarded to each shard. */ - static std::unique_ptr<FindCommandRequest> _parseCmdObjectToFindCommandRequest( + std::unique_ptr<FindCommandRequest> _parseCmdObjectToFindCommandRequest( OperationContext* opCtx, NamespaceString nss, BSONObj cmdObj) { auto findCommand = query_request_helper::makeFromFindCommand( std::move(cmdObj), @@ -301,6 +307,7 @@ public: invariant(findCommand->getNamespaceOrUUID().nss()); processFLEFindS( opCtx, findCommand->getNamespaceOrUUID().nss().get(), findCommand.get()); + _didDoFLERewrite = true; } return findCommand; @@ -308,6 +315,7 @@ public: const OpMsgRequest& _request; const DatabaseName _dbName; + bool _didDoFLERewrite{false}; }; }; |