diff options
author | Ben Shteinfeld <ben.shteinfeld@mongodb.com> | 2022-08-17 21:16:10 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-17 23:52:54 +0000 |
commit | 43f9a78849f884bd01608ee5129eb7ac6df16b4f (patch) | |
tree | 7f1df7c36f0d4f16d987e2d9498b5e0edba414ce /src/mongo/db/stats | |
parent | d798c5fd75a5854fb8fefc590280aa701fa5e420 (diff) | |
download | mongo-43f9a78849f884bd01608ee5129eb7ac6df16b4f.tar.gz |
SERVER-62760 Implement CQF Query Logging
Diffstat (limited to 'src/mongo/db/stats')
-rw-r--r-- | src/mongo/db/stats/counters.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/stats/counters.h | 37 |
2 files changed, 23 insertions, 16 deletions
diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp index fca895940da..44328202169 100644 --- a/src/mongo/db/stats/counters.cpp +++ b/src/mongo/db/stats/counters.cpp @@ -318,7 +318,7 @@ NetworkCounter networkCounter; AuthCounter authCounter; AggStageCounters aggStageCounters; DotsAndDollarsFieldsCounters dotsAndDollarsFieldsCounters; -QueryEngineCounters queryEngineCounters; +QueryFrameworkCounters queryFrameworkCounters; LookupPushdownCounters lookupPushdownCounters; OperatorCounters operatorCountersAggExpressions{"operatorCounters.expressions."}; diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h index 0a6273e6fba..e4f12ce7d46 100644 --- a/src/mongo/db/stats/counters.h +++ b/src/mongo/db/stats/counters.h @@ -308,9 +308,9 @@ public: extern DotsAndDollarsFieldsCounters dotsAndDollarsFieldsCounters; -class QueryEngineCounters { +class QueryFrameworkCounters { public: - QueryEngineCounters() = default; + QueryFrameworkCounters() = default; void incrementQueryEngineCounters(CurOp* curop) { auto& debug = curop->debug(); @@ -336,25 +336,32 @@ public: sbeOnlyAggregationCounter.increment(); } } + } else if (debug.cqfUsed) { + if (cmdName == "find") { + cqfFindQueryCounter.increment(); + } else { + cqfAggregationQueryCounter.increment(); + } } } - // Query counters that record whether a find query was fully or partially executed in SBE, or - // fully executed using the classic engine. One or the other will always be incremented during a - // query. - CounterMetric sbeFindQueryCounter{"query.queryExecutionEngine.find.sbe"}; - CounterMetric classicFindQueryCounter{"query.queryExecutionEngine.find.classic"}; + // Query counters that record whether a find query was fully or partially executed in SBE, fully + // executed using the classic engine, or fully executed using the common query framework (CQF). + // One of these will always be incremented during a query. + CounterMetric sbeFindQueryCounter{"query.queryFramework.find.sbe"}; + CounterMetric classicFindQueryCounter{"query.queryFramework.find.classic"}; + CounterMetric cqfFindQueryCounter{"query.queryFramework.find.cqf"}; // Aggregation query counters that record whether an aggregation was fully or partially executed - // in DocumentSource (an sbe/classic hybrid plan), or fully pushed down to the sbe/classic - // layer. Only incremented during aggregations. - CounterMetric sbeOnlyAggregationCounter{"query.queryExecutionEngine.aggregate.sbeOnly"}; - CounterMetric classicOnlyAggregationCounter{"query.queryExecutionEngine.aggregate.classicOnly"}; - CounterMetric sbeHybridAggregationCounter{"query.queryExecutionEngine.aggregate.sbeHybrid"}; - CounterMetric classicHybridAggregationCounter{ - "query.queryExecutionEngine.aggregate.classicHybrid"}; + // in DocumentSource (an sbe/classic hybrid plan), fully pushed down to the sbe/classic layer, + // or executed using CQF. These are only incremented during aggregations. + CounterMetric sbeOnlyAggregationCounter{"query.queryFramework.aggregate.sbeOnly"}; + CounterMetric classicOnlyAggregationCounter{"query.queryFramework.aggregate.classicOnly"}; + CounterMetric sbeHybridAggregationCounter{"query.queryFramework.aggregate.sbeHybrid"}; + CounterMetric classicHybridAggregationCounter{"query.queryFramework.aggregate.classicHybrid"}; + CounterMetric cqfAggregationQueryCounter{"query.queryFramework.aggregate.cqf"}; }; -extern QueryEngineCounters queryEngineCounters; +extern QueryFrameworkCounters queryFrameworkCounters; class LookupPushdownCounters { public: |