Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50428

Expose diagnostics to client queries

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Diagnostics
    • Labels:
      None

      Description

      Currently, the only way for clients to access query diagnostics is through the explain command; there's no way to access that information when issuing normal queries. We'd like to introduce a flag to find (and potentially other query commands) that includes some basic diagnostic information (keysExamined, docsExamined, hasSortStage, and ideally planSummary) as part of the query response. This enables building smarter clients that have a better understanding of their performance impact.

      As an example use case, we'd like background batch job clients to throttle themselves based on the load they generate on the database. In theory we could use number of queries issued or documents returned, but keysExamined, docsExamined, and hasSortStage are a much more precise indicator of the performance impact of queries.

      I put together a quick sketch implementation to demonstrate what the interface might look like.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-query Backlog - Query Team (Inactive)
              Reporter:
              evan@stripe.com Evan Broder
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: