Add change stream process-level throughput metrics on mongoD

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: Change streams
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-07-06, QE 2026-07-20
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add change stream specific throughput metrics on mongoD (see project design document section "Decision: Process-Level Change Stream Cursor Metrics / Throughput"):

      • metrics.changeStreams.cursor.docsReturned(already exists for query stats)
      • metrics.changeStreams.cursor.bytesReturned
      • metrics.changeStreams.cursor.docsExamined
      • metrics.changeStreams.cursor.bytesRead
      • metrics.changeStreams.cursor.batchesReturned(already exists for query stats)

      Design notes:

      • Check if any of the metrics are already collected in the OpDebug::AdditiveMetrics structure. We may re-use / extend this structure with the missing metrics, unless there are performance regressions or other reasons.
      • The process-level metrics must be updated once per aggregate or getMore command execution.
      • Incrementing docsReturned, bytesReturned, and batchesReturned should be straight-forward (we inspect batch sizes continuously not to exceed 16MB limit)
      • Incrementing docsExamined and bytesExamined can be trickier, because these come from the "classic" find subsystem doing the collection scan. However, it looks like there is docsExamined and bytesRead already in the OpDebug::AdditiveMetrics.

      Please feel encouraged to split this ticket into subtasks.

            Assignee:
            Athena Wang
            Reporter:
            Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: