summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/telemetry.h
diff options
context:
space:
mode:
authorjoshua <80741223+jlap199@users.noreply.github.com>2022-11-15 03:55:41 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-15 04:37:36 +0000
commit0fff039b24fa1fdf14d940c5de7dbfc90e59d5a6 (patch)
tree0dea056531605ccbd796a99554a3a6b2c11cfd21 /src/mongo/db/query/telemetry.h
parent942719f40be8488c3644ebc4dbf4f18fb3220e93 (diff)
downloadmongo-0fff039b24fa1fdf14d940c5de7dbfc90e59d5a6.tar.gz
SERVER-71315 Decide where to store the Telemetry key
Diffstat (limited to 'src/mongo/db/query/telemetry.h')
-rw-r--r--src/mongo/db/query/telemetry.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/mongo/db/query/telemetry.h b/src/mongo/db/query/telemetry.h
index 6fd59884ac4..3a2f41a7e4e 100644
--- a/src/mongo/db/query/telemetry.h
+++ b/src/mongo/db/query/telemetry.h
@@ -163,33 +163,31 @@ std::unique_ptr<TelemetryStore> resetTelemetryStore(const ServiceContext* servic
bool isTelemetryEnabled(const ServiceContext* serviceCtx);
/**
- * Should we collect telemetry for a request? The decision is made based on the feature flag and
- * telemetry parameters such as rate limiting.
+ * Register a request for telemetry collection. The telemetry machinery may decide not to collect
+ * anything but this should be called for all requests. The decision is made based on the feature
+ * flag and telemetry parameters such as rate limiting.
*
- * If the return value is a telemetry key in the form of BSONObj, this indicates the telemetry
- * should be collected. Otherwise, telemetry should not be collected.
+ * The caller is still responsible for subsequently calling collectTelemetry() once the request is
+ * completed.
*
* Note that calling this affects internal state. It should be called once for each request for
* which telemetry may be collected.
*/
-boost::optional<BSONObj> shouldCollectTelemetry(const AggregateCommandRequest& request,
- const OperationContext* opCtx);
+void registerAggRequest(const AggregateCommandRequest& request, OperationContext* opCtx);
-boost::optional<BSONObj> shouldCollectTelemetry(const FindCommandRequest& request,
- const NamespaceString& collection,
- const OperationContext* opCtx);
+void registerFindRequest(const FindCommandRequest& request,
+ const NamespaceString& collection,
+ OperationContext* opCtx);
-boost::optional<BSONObj> shouldCollectTelemetry(const OperationContext* opCtx,
- const BSONObj& telemetryKey);
+void registerGetMoreRequest(OperationContext* opCtx, const PlanExplainer& planExplainer);
+
+void recordExecution(const OperationContext* opCtx, const OpDebug& opDebug, bool isFle);
/**
* Collect telemetry for the operation identified by `key`. The `isExec` flag should be set if it's
* the beginning of execution (first batch) of results and not set for subsequent getMore() calls.
*/
-void collectTelemetry(const ServiceContext* serviceCtx,
- const BSONObj& key,
- const OpDebug& opDebug,
- bool isExec);
+void collectTelemetry(const OperationContext* opCtx, const OpDebug& opDebug);
} // namespace telemetry
} // namespace mongo