From bae712c9891ad30c4fa9e1413efa4b3f3aa5c828 Mon Sep 17 00:00:00 2001 From: Ben Shteinfeld Date: Tue, 8 Nov 2022 21:40:31 +0000 Subject: SERVER-68847 Include query framework information in GetMore profiler entries --- src/mongo/db/stats/counters.h | 53 +++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'src/mongo/db/stats/counters.h') diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h index 65b15958c59..d066202d375 100644 --- a/src/mongo/db/stats/counters.h +++ b/src/mongo/db/stats/counters.h @@ -323,31 +323,40 @@ public: auto& debug = curop->debug(); const BSONObj& cmdObj = curop->opDescription(); auto cmdName = cmdObj.firstElementFieldNameStringData(); - if (cmdName == "find" && debug.classicEngineUsed) { - if (debug.classicEngineUsed.get()) { - classicFindQueryCounter.increment(); - } else { - sbeFindQueryCounter.increment(); + + if (cmdName == "find") { + switch (debug.queryFramework) { + case PlanExecutor::QueryFramework::kClassicOnly: + classicFindQueryCounter.increment(); + break; + case PlanExecutor::QueryFramework::kSBEOnly: + sbeFindQueryCounter.increment(); + break; + case PlanExecutor::QueryFramework::kCQF: + cqfFindQueryCounter.increment(); + break; + default: + break; } - } else if (cmdName == "aggregate" && debug.classicEngineUsed && debug.documentSourceUsed) { - if (debug.classicEngineUsed.get()) { - if (debug.documentSourceUsed.get()) { - classicHybridAggregationCounter.increment(); - } else { + } else if (cmdName == "aggregate") { + switch (debug.queryFramework) { + case PlanExecutor::QueryFramework::kClassicOnly: classicOnlyAggregationCounter.increment(); - } - } else { - if (debug.documentSourceUsed.get()) { - sbeHybridAggregationCounter.increment(); - } else { + break; + case PlanExecutor::QueryFramework::kClassicHybrid: + classicHybridAggregationCounter.increment(); + break; + case PlanExecutor::QueryFramework::kSBEOnly: sbeOnlyAggregationCounter.increment(); - } - } - } else if (debug.cqfUsed) { - if (cmdName == "find") { - cqfFindQueryCounter.increment(); - } else { - cqfAggregationQueryCounter.increment(); + break; + case PlanExecutor::QueryFramework::kSBEHybrid: + sbeHybridAggregationCounter.increment(); + break; + case PlanExecutor::QueryFramework::kCQF: + cqfAggregationQueryCounter.increment(); + break; + case PlanExecutor::QueryFramework::kUnknown: + break; } } } -- cgit v1.2.1