Refactor the assignment of responsibilities for query stats collection

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Create a common QueryStatsInfo struct similar to

      struct QueryStatsInfo {
          std::unique_ptr<query_stats::Key> key;
          boost::optional<std::size_t> keyHash;
          bool disableForSubqueryExecution = false;
          struct CursorInfo {
              bool willNeverExhaust = false;
          } cursorInfo;
          struct SingleOpInfo {
              bool metricsRequested = false;
          } singleOpInfo;
      };
      

      This will be used for both the OpDebug/CurOp QueryStatsInfo and also the ClientCursor and ClusterClientCursor.

      This will allow for

      • move checks/functions that use queryStatsInfo inside the struct and clean up query stats code overall
      • pass QueryStatsInfo to writeQueryStats() and collectQueryStatsMongod/s instead of passing the key itself/flags to divorce std::moving the key from these calls.
      • Use disableForSubQueryExecution/willNeverExhaust flags within writeQueryStats() to determine if the query should be collected.

      And in general, it would be nice to add comments explaining some of the logic surrounding querystats.

              Assignee:
              Unassigned
              Reporter:
              Mariano Shaar
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: