summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_cursor_manager.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/s/query/cluster_cursor_manager.cpp
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/s/query/cluster_cursor_manager.cpp')
-rw-r--r--src/mongo/s/query/cluster_cursor_manager.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/mongo/s/query/cluster_cursor_manager.cpp b/src/mongo/s/query/cluster_cursor_manager.cpp
index 4452e6a8811..1209d709e22 100644
--- a/src/mongo/s/query/cluster_cursor_manager.cpp
+++ b/src/mongo/s/query/cluster_cursor_manager.cpp
@@ -41,7 +41,6 @@
#include "mongo/db/kill_sessions_common.h"
#include "mongo/db/logical_session_cache.h"
#include "mongo/db/query/query_knobs_gen.h"
-#include "mongo/db/query/query_stats/query_stats.h"
#include "mongo/logv2/log.h"
#include "mongo/util/clock_source.h"
#include "mongo/util/str.h"
@@ -247,7 +246,6 @@ StatusWith<ClusterCursorManager::PinnedCursor> ClusterCursorManager::checkOutCur
cursorGuard->reattachToOperationContext(opCtx);
CurOp::get(opCtx)->debug().queryHash = cursorGuard->getQueryHash();
- CurOp::get(opCtx)->debug().queryStatsInfo.keyHash = cursorGuard->getQueryStatsKeyHash();
return PinnedCursor(this, std::move(cursorGuard), entry->getNamespace(), cursorId);
}
@@ -576,60 +574,4 @@ StatusWith<ClusterClientCursorGuard> ClusterCursorManager::_detachCursor(WithLoc
return std::move(cursor);
}
-
-void collectQueryStatsMongos(OperationContext* opCtx, std::unique_ptr<query_stats::Key> key) {
- // If we haven't registered a cursor to prepare for getMore requests, we record
- // queryStats directly.
- auto&& opDebug = CurOp::get(opCtx)->debug();
- int64_t execTime = opDebug.additiveMetrics.executionTime.value_or(Microseconds{0}).count();
- query_stats::writeQueryStats(opCtx,
- opDebug.queryStatsInfo.keyHash,
- std::move(key),
- execTime,
- execTime,
- opDebug.additiveMetrics.nreturned.value_or(0));
-}
-
-void collectQueryStatsMongos(OperationContext* opCtx, ClusterClientCursorGuard& cursor) {
- cursor->incrementCursorMetrics(CurOp::get(opCtx)->debug().additiveMetrics);
-
- // For a change stream query that never ends, we want to collect query stats on the initial
- // query and each getMore. Here we record the initial query.
- // TODO SERVER-89058 Modify comment to include tailable cursors.
- if (cursor->getQueryStatsWillNeverExhaust()) {
- auto& opDebug = CurOp::get(opCtx)->debug();
-
- int64_t execTime = opDebug.additiveMetrics.executionTime.value_or(Microseconds{0}).count();
-
- query_stats::writeQueryStats(opCtx,
- opDebug.queryStatsInfo.keyHash,
- cursor->takeKey(),
- execTime,
- execTime,
- opDebug.additiveMetrics.nreturned.value_or(0),
- cursor->getQueryStatsWillNeverExhaust());
- }
-}
-
-void collectQueryStatsMongos(OperationContext* opCtx, ClusterCursorManager::PinnedCursor& cursor) {
- cursor->incrementCursorMetrics(CurOp::get(opCtx)->debug().additiveMetrics);
-
- // For a change stream query that never ends, we want to update query stats for every getMore on
- // the cursor.
- // TODO SERVER-89058 Modify comment to include tailable cursors.
- if (cursor->getQueryStatsWillNeverExhaust()) {
- auto& opDebug = CurOp::get(opCtx)->debug();
-
- int64_t execTime = opDebug.additiveMetrics.executionTime.value_or(Microseconds{0}).count();
-
- query_stats::writeQueryStats(opCtx,
- opDebug.queryStatsInfo.keyHash,
- nullptr,
- execTime,
- execTime,
- opDebug.additiveMetrics.nreturned.value_or(0),
- cursor->getQueryStatsWillNeverExhaust());
- }
-}
-
} // namespace mongo