summaryrefslogtreecommitdiff
path: root/src/mongo/db/clientcursor.cpp
diff options
context:
space:
mode:
authorDavis Haupt <davis.haupt@mongodb.com>2023-03-20 21:31:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-20 22:28:55 +0000
commit5531212069bee2a38fff2e9c926b2748fdb6b523 (patch)
tree7296b423a673b14905e258ac704ea60ef2d61ccc /src/mongo/db/clientcursor.cpp
parent7a00cd0798725c1d635885788cff9729936f6456 (diff)
downloadmongo-5531212069bee2a38fff2e9c926b2748fdb6b523.tar.gz
SERVER-73494 Hook new shapification up to telemetry store for find command
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r--src/mongo/db/clientcursor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index b901cbef362..2899c038f91 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -157,7 +157,8 @@ void ClientCursor::dispose(OperationContext* opCtx, boost::optional<Date_t> now)
}
if (_telemetryStoreKey && opCtx) {
- telemetry::writeTelemetry(opCtx, _telemetryStoreKey, _queryExecMicros, _docsReturned);
+ telemetry::writeTelemetry(
+ opCtx, _telemetryStoreKey, getOriginatingCommandObj(), _queryExecMicros, _docsReturned);
}
if (now) {
@@ -397,7 +398,7 @@ void collectTelemetryMongod(OperationContext* opCtx, ClientCursorPin& pinnedCurs
opDebug.nreturned);
}
-void collectTelemetryMongod(OperationContext* opCtx) {
+void collectTelemetryMongod(OperationContext* opCtx, const BSONObj& originatingCommand) {
auto&& opDebug = CurOp::get(opCtx)->debug();
// If we haven't registered a cursor to prepare for getMore requests, we record
// telemetry directly.
@@ -406,6 +407,7 @@ void collectTelemetryMongod(OperationContext* opCtx) {
// additiveMetrics.queryExecMicros isn't set until curOp is closing out.
telemetry::writeTelemetry(opCtx,
opDebug.telemetryStoreKey,
+ originatingCommand,
CurOp::get(opCtx)->elapsedTimeExcludingPauses().count(),
opDebug.nreturned);
}